0

我正在使用 Delegate 方法从子视图中获取数据,并希望在根视图中动态编辑我的表。

所以我想在我的 viewWillAppear 方法中做这样的事情:

[myTable setCell:newCell atIndex:i];

我该怎么办 ?非常感谢

4

2 回答 2

0

将您的代码放在两者之间:

[myTable beginUpdates];
//your code
[myTable setCell:newCell atIndex:i];
//your code end
[myTable endUpdates];
于 2012-05-26T18:25:38.927 回答
0

好吧,最后我使用了:

[cellules beginUpdates];
[cellules reloadData];
[cellules endUpdates];

我使用了 reloadData,因为它是一个小的 TableView(3 个单元格),对于大的 TableViews 这应该更好:

– reloadRowsAtIndexPaths:withRowAnimation:

不管怎么说,还是要谢谢你 !

于 2012-05-26T19:51:14.923 回答