我如何可以將一個可用的當前行數量存儲到一個變量?UITableView在iPhone應用程序 - 如何獲得行數
這是我的表的代碼(我認爲可能是相關的):
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];
}
對不起,我不明白這個問題。該方法看起來很好,你爲什麼要改變它?如果你想存儲它,爲什麼不把它存儲在伊娃裏? – Eiko 2010-12-07 21:24:11
我不確定我是否理解它?!是不是隻是在上面的方法中將[sectionInfo numberOfObjects]存儲到NSInteger中? – Rog 2010-12-07 21:29:03
是嗎?那就是我的答案! – benhowdle89 2010-12-07 21:30:38