刷新表视图行
我有一个 UISegmentedControl 来更改表视图中的数据。
[self.mySexyTableView reloadRowsAtIndexPaths:updatedPaths withRowAnimation:UITableViewRowAnimationTop];
假设我为选项卡一显示 5 行,为选项卡二显示 2 行。 单击第二个选项卡时,前两行将获取新值,但第 3 行至第 5 行的第一个选项卡中的旧数据仍然保留。 我怎样才能清除它们?
I have a UISegmentedControl
that changes the data in the table view.
[self.mySexyTableView reloadRowsAtIndexPaths:updatedPaths withRowAnimation:UITableViewRowAnimationTop];
Let's say that I display 5 rows for tab one, 2 rows for tab two. When the second tab is clicked the first two rows get new values but the old data from tab one for rows 3 to 5 remains. How can I clear them out ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是一个可供查看的快速示例代码:iPhoneCoreDataRecipes
下面 ,这是提供的最甜蜜的方法之一:
我遇到了这个问题,如果我理解正确的话,更新不会删除单元格。 因此,只需删除它们,然后调用更新即可。 祝你好运!
Here's a quick sample code to check out: iPhoneCoreDataRecipes
On topic, here is one of the sweetest provided methods:
I ran into this problem, if I understand you properly, that updating doesn't remove cells. So just remove them and then call update. Good luck!