Core Data table record count
- by user339633
I have an entity called Person and it has a relationship called participatingGames, to another entity called GameParticipant.
I (apparently) can retrieve the number of matches in the GameParticipant entity using this simple code in the Person object I created from the entity in the model:
[self.participatingGames count];
However, I'd just like to retrieve the number of Person records and one might guess the syntax for this is just as simple.
I have lots of books including those by Jeff LaMarche, but those sources and what I find around here make me wonder if I need to set up a fetchedResultsController just to know the count of some entity.
My background is in SQL, so of course it seems odd that what would take 15 seconds to code in any other environment seems like such a well-guarded secret in Core Data.
I'm using iPhone SDK 3.1.4 under OSX 10.5.8
Suggestions?