我正在为 iPhone 制作一个基于导航的应用程序。
我的视图控制器之一如下所示:
@interface NewComputerViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
所以我用的是UITableView
显示数据。
当视图加载时,我使用顶部导航栏中的按钮来运行函数loadStuff
在字典中加载一些内容。
我的问题:如何重新填充该视图控制器中的表视图loadStuff
函数(属于视图控制器)
您可以随时使用[tableView reloadData]
method!
但是,如果您在本地存储了一些数据并从某个服务器加载新内容,那么您可以:
[tableView beginUpdates];
[tableView insertRowsAtIndexPaths:*arrayOfIndexPaths* withRowAnimation:*rowAnimation*];
[tableView endUpdates];
如果你想删除现有行,你可以使用
[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:*arrayOfIndexPaths* withRowAnimation:*rowAnimation*];
[tableView endUpdates];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)