Hi guys,
I've come into a strange situation with my NSFetchedResultsController. I've set it up with a predicate, and the sqlite3 table contains no entries when the app is loaded. Yet my controller sais that the one section in it contains two rows!
One section is fine:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [[fetchedResultsController sections] count];
}
But two rows???
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
id <NSFetchedResultsSectionInfo> sectionInfo = [[fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];
}
If I instead did
return [[self.fetchedResultsController fetchedObjects] count];
that would be more correct, but why is the first way of doing it wrong? What would make it say two objects?
Cheers
Nik