Monday, 12 August 2013

One row per section - NSFetchedResultsController

One row per section - NSFetchedResultsController

I am trying to implement the delegate methods for my UITableView so that
there is exactly 1 row per section. The number of sections will equal the
number of managed objects retrieved from the fetch.
I am using an NSFetchResultsController, but I keep getting a run-time
error when [self.tableview endUpdates] is called.
Here's my code:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [[self.fetchedResultsController fetchedObjects] count];
}
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section {
return 1;
}
Any help would be greatly appreciated.

No comments:

Post a Comment