我正在使用委託方法從子視圖獲取數據,並且想要在根視圖中動態編輯我的表。如何更新UITableView中的單元格?
所以我願做這樣的事情在我的viewWillAppear中的方法:
[myTable setCell:newCell atIndex:i];
我該怎麼辦?非常感謝
我正在使用委託方法從子視圖獲取數據,並且想要在根視圖中動態編輯我的表。如何更新UITableView中的單元格?
所以我願做這樣的事情在我的viewWillAppear中的方法:
[myTable setCell:newCell atIndex:i];
我該怎麼辦?非常感謝
好了,終於我把它用:
[cellules beginUpdates];
[cellules reloadData];
[cellules endUpdates];
我用reloadData,因爲它是一個小的TableView(3個單元),用於大TableViews這應該是更好的:
– reloadRowsAtIndexPaths:withRowAnimation:
無論如何感謝!
把你的代碼之間:
[myTable beginUpdates];
//your code
[myTable setCell:newCell atIndex:i];
//your code end
[myTable endUpdates];
不,我的意思是,有沒有辦法更新我的單元看起來像這個函數? – Rob
可能重複[是否有可能刷新UITableView中的單個UITableViewCell?](http://stackoverflow.com/questions/4448321/is-it-possible-to-refresh-a-single-uitableviewcell-in -a-uitableview) –