I have a NSManageObject set up as an Entity in Core Data. After fetching the Entity, I want to be able to pull all of the attributes and put them into an NSMutableArray to populate a UITableView with.
For Example:
Entity:
Project
Attributes: startDate(required); finishDate(optional); projectName(required); etc….
How do I get all of these into an NSMutableArray? Or is there a better way to populate the UITableView?
You can get this by asking the
NSEntityDescriptionfor itsNSAttributeDescriptionobjects:Note: this only contains attributes, not relationships. If you want only relationship values, you can use
-relationshipsByName. If you want both attributes and relationships, you can use-propertiesByName.Deciding whether this is a good idea or not is left as an exercise to the reader.