我正在使用一个获取的结果控制器,它似乎想要使用我的 UITableView 中的部分进行设置。好吧,在这种情况下,我不想使用部分。其中,将 numberOfSectionsInTableView: 的值设置为 1 很容易。但是,现在我不确定如何获取 numberOfRowsInSection: 以将所有单元格返回到一个部分中。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
id <NSFetchedResultsSectionInfo> sectionInfo = [[fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];
}
我怎样才能使该方法返回所有单元格,因为我只想使用 1 个部分?