final answer
Updating my answer after chat session. Switching to TLIndexPathTools's TLIndexPathController
instead of NSFetchedResultsController
resolved the issue.
answer #2
It sounds like you're saying the following method is returning zero:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [[[self.fetchedResultsController sections] objectAtIndex:section] numberOfObjects];
}
And that you've verified the fetchedResultsController
is set and that you've called performFetch
and that the results are non-zero, i.e. the fetchedObjects
property is returning a non-empty array. I don't see how all of those things can be true and have the above method return 0. Can you put a breakpoint in the above method and re-verify these things? Perhaps this method is getting called before you call performFetch
.
If you continue to be stuck, you could try my TLIndexPathTools library. It provides an alternative to NSFetchedResultsController
. Check out the Core Data sample project.
answer #1
Check that you're setting the fetchedResultsController
property of your table view controller. From the description of your problem, it sounds like this property is nil
.