I am really confused about this.
I see situations where [[NSFetchedResultsController sections] count] is used.
Then there are these situations, [[self.fetchedResultsController fetchedObjects] count].
Now i understand what the latter one is doing. that just makes sense to me.
But i don’t understand the first one regarding the sections.
The document doesn’t define sections. It actually defines it by using the term “sections” with its definition.
thanks.
If you set a
sectionNameKeyPath:in theinitWithFetchRequest:...call, then the fetched results controller will group the results into sections, corresponding to the sections of a table view.So
[[NSFetchedResultsController sections] count]is the number of sections and[[self.fetchedResultsController fetchedObjects] count]is the total number of all fetched objects.