iPhone: Fetched Results Controller, don't use sections in UITableView

Posted by Nic Hubbard on Stack Overflow See other posts from Stack Overflow or by Nic Hubbard
Published on 2010-06-06T04:50:26Z Indexed on 2010/06/06 4:52 UTC
Read the original article Hit count: 301

I am using a fetched results controller, which, it seems wants to set up using sections in my UITableView. Well, in this case, I don't want to use sections. Which, is easy enough to set the value for numberOfSectionsInTableView: to 1. But, now I am not sure how to get the numberOfRowsInSection: to return all of the cells into one section.

- (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];
}

How can I make that method return all the cells, since I only want to use 1 section?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk