【发布时间】:2011-08-02 06:02:02
【问题描述】:
我有一个视图,我想在其中显示 UITableView 并制作动画以添加行。在我的 .m 中,我将它设置为带有 UITableView 子类的 UIViewController。我将我的数据源和委托与我的文件所有者联系起来。
因为当试图调用这样的东西不起作用时:[self.tableView reloadData]',我创建了一个 UITableView IBOutlet 来执行此操作 - theTableView。
当尝试调用添加对象时:
NSArray *insertIndexPaths = [[NSArray alloc] initWithObjects:
[NSIndexPath indexPathForRow:0 inSection:0],
[NSIndexPath indexPathForRow:1 inSection:0],
[NSIndexPath indexPathForRow:2 inSection:0],
nil];
[theTableView beginUpdates];
[theTableView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationFade];
[theTableView endUpdates];
它启动,但调用 viewDidLoad 时没有任何反应。我无法将其设为 UITableViewController,因为其中还有许多其他项目。
对不起,如果我的术语听起来有点不对劲 - 我不擅长这个。任何帮助表示赞赏!
库尔顿
【问题讨论】:
-
如何将 UITableView 添加到视图中?
-
我用 NSMutableArray 填充它。
标签: objective-c xcode ios4 uiviewcontroller uitableview