Core Data properties in code

Discussion in 'Mac Programming' started by theunixgeek, Jun 12, 2009.

  1. macrumors newbie

    Joined:
    Jun 25, 2008
    #1
    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?
     
  2. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    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;
     

Share This Page