Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

theunixgeek

macrumors newbie
Original poster
Jun 25, 2008
13
0
How can I access a Core Data entity's properties in code? I have an entity with title (string) and description (binary) properties. Is there a way to retrieve these two arrays programmatically so I can use them in a for-loop?
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
How can I access a Core Data entity's properties in code? I have an entity with title (string) and description (binary) properties. Is there a way to retrieve these two arrays programmatically so I can use them in a for-loop?

Code:
NSArray *nameArray = myCoreDataObject.name;
NSArray *descriptionArray = myCoreDataObject.description;

"name" and "description" don't sound like arrays to me though, if those are arrays as you say, they are poorly named. If they are simple properties instead, it would be something like:

Code:
NSString *aName = myCoreDataObject.name;
NSData *description = myCoreDataObject.description;
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.