How to return the number of rows in a UITableView with Core Data

- by

Likewise, here’s how we return the number of rows using a fetched results controller – as provided by the Master / Detail template:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections]objectAtIndex:section];
        
    return [sectionInfo numberOfObjects];
}


If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site witout any pesky ads! More details here.

Add your voice!

This site uses Akismet to reduce spam. Learn how your comment data is processed.