我有一個視圖,我想顯示一個UITableView和動畫添加行。在我的.m中,我將它設置爲具有UITableView子類的UIViewController。我有我的數據源和委託與我的文件的所有者鏈接。用動畫插入UITableView?
因爲當試圖調用這樣的東西不會工作:[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,因爲我有許多其他項目。
對不起,如果我的行話聽起來有點不對 - 我是一個noobie在這。任何幫助表示讚賞!
庫爾頓
你如何將UITableView添加到你的視圖? – 2011-04-09 21:15:00
我使用NSMutableArray填充它。 – iosfreak 2011-04-09 21:39:55