Core Data fetchedresultscontroller question : what is "sections" for?
- by Jake
Hi, I'm trying to get to know Core Data (I'm a noob at iPhone development) and in order to do this I'm trying to get an object from the fetchedresultscontroller and NSlog it's name (a property of the object). I tried to do it like this:
NSArray *ar = [NSArray arrayWithArray:[fetchedResultsController sections]];
Task *t = [ar objectAtIndex:0];
NSLog(@"%@", t.taskName);
However, the app crashed with this error: the app crashes with the error
Terminating app due to uncaught
exception
'NSInvalidArgumentException', reason:
'* -[_NSDefaultSectionInfo
taskName]: unrecognized selector sent
to instance 0x3d1f670'
I have since learned that you need to use the fetched objects property for this, but then what is sections for? Thanks for any help, sorry if this is a supremely stupid question. I've looked over the documentation but still don't understand.