我有一個單獨的對象,它具有ivar NSMutableArray
,它將全局圖像保存到應用程序中。我有一個UITableViewController
類代表圖像附加到消息。我想要做的下一個:當用戶從相機膠捲選擇圖像,他們被添加到該單身人士的數組。我想立即重新加載我的UITableViewController
的tableview
以顯示這些新消息。我怎樣才能實現這個?我應該使用Key-Value Observing來解決這個問題嗎?如果是的話,我該怎麼做? (我應該通知何時將新對象添加到數組中)。或者可能有其他更正確的方法?當我向另一個類中的NSMutableArray添加一個新元素時如何重新加載UITableView?
0
A
回答
1
我確切地知道什麼ü需要做。 Download this Demo僅供參考。
它具有委派方法
- (void)imagePicker:(GKImagePicker *)imagePicker pickedImage:(UIImage *)image{
// add your code here for adding image to Your mutable array and then Reload your tableView.
}
0
當你想要重新加載視圖時,發送NSNotification
怎麼樣?
UITableView
可以接收通知並重新載入數據。
0
新增通知中類有表
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(actionremovecalender:)
name:@"subMitReport"
object:nil];
-(void)actionremovecalender:(NSNotification *)notification
{
//table relaod code
}
call to another class
[[NSNotificationCenter defaultCenter] postNotificationName:@"subMitReport" object:self];
相關問題
- 1. 從另一個類重新加載UITableView?
- 2. 當我的plist更新時試圖重新加載一個UItableview?
- 3. 從另一個類重新加載webview
- 4. 添加一個新行中一個UITableView
- 5. 當我點擊一個元素添加另一個ID或
- 6. 當子程序從另一個類中分類時,vb.net類會重新加載
- 7. 每當我添加一個新類時,需要將自動加載轉儲到每次添加新類時
- 8. 添加一個元素的新實例
- 9. 添加一個NSMuatblearray到另一個NSMutablearray?
- 10. 當單擊另一個元素時,jQuery添加類刪除
- 11. 向父元素添加一個類
- 12. Twitter引導。當添加類「詞綴」時添加一個新類
- 13. 如何從另一個課程重新加載我的表格?
- 14. Pont動態添加元素來加載另一個元素
- 15. 如果元素具有類添加類到另一個元素
- 16. 添加NSMutableArray到另一個NSMutableArray
- 17. 從另一個iframe重新加載iframe
- 18. 從另一個tabbar重新加載tabbarView?
- 19. 當頁面重新加載時,定位另一個ID屬性
- 20. 從另一個選項卡重新加載UITableView
- 21. 從另一個視圖重新加載數據uitableview
- 22. 如何從另一個類重新加載表? - 可可
- 23. 如何使用Ionic3從另一個類重新加載頁面
- 24. a4j:repeat - 動態添加一個新元素
- 25. 如何向ASP.NET中的元素添加多於一個的類?
- 26. 如何重新加載一個UItableView的行和部分
- 27. 列表當我添加一個新的
- 28. 向量的每個元素添加到另一個向量
- 29. UITableview從另一個類添加數據
- 30. 向另一個列表中的列表添加唯一元素
當添加對象陣列通話[tableview中reloadData] –