Core Data fetchedresultscontroller question : what is "sections" for?
Posted
by Jake
on Stack Overflow
See other posts from Stack Overflow
or by Jake
Published on 2010-05-11T08:46:05Z
Indexed on
2010/05/11
9:04 UTC
Read the original article
Hit count: 388
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.
© Stack Overflow or respective owner