iphone - 插入行而不重新加载表

标签 iphone objective-c ios uitableview

你好,我有一个 tableview,里面有很多对象。如果我想在其中添加一行而不重新加载整个表格。因为cell中有一些进程。有人可以帮忙吗?

最佳答案

你可以通过两种方式做到这一点 -

[tableView beginUpdates];
[tableView insertRowsAtIndexPaths:newResults withRowAnimation:UITableViewRowAnimationNone];
[tableView endUpdates];

[tableView insertRowsAtIndexPaths:newResults withRowAnimation:UITableViewRowAnimationNone];

此处 newResults 是您需要创建的 NSIndexPathNSArray。然后在这些行中插入新行(有或没有动画)。

关于iphone - 插入行而不重新加载表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8655258/

相关文章:

iphone - 是否有任何工具可以浏览您应用程序的 iCloud 数据?

objective-c - 如何在 Objective-C 中将值附加到数组

ios - 如何在ios中实现原生应用登录?

ios - 由于未捕获的异常 'NSInternalInconsistencyException' 而终止应用程序,原因 : 'Invalid parameter not satisfying: self.senderId != nil'

iphone - 如何访问 NSString 中的第 n 个字符?

iphone - 我拥有的 NSManagedObject 被 main.m 释放了吗?

iphone - 我可以在没有搜索栏的情况下显示 UITableView 的索引(在sectionIndexTitles UiTableView 中)吗?

ios - UISplitViewController - 带有 UINavigationController 的多个细节 View

iphone - 渐变背景 UIScrollView

ios - Xcode 5 : Unit Tests not running