0

I've created some ManagedObjects and for each of them I added the User Info Key/Value of DisplayName

Example:

       Attribute: eReader
   User Info Key: DisplayName
 User Info Value: E-Reader

      Attribute: weather 
  User Info Key: DisplayName
User Info Value: Weather Radar

I was hoping to Query the entire NSManagedObject from code and then iterate through each attribute and display their DisplayName on the screen. Any guidance as to how to do this?

This way I could show a table of User Readable text but each entry was mapped to the correct NSManagedObject attribute which cannot start with either uppercase or have spaces in them.

Jeef
  • 26,861
  • 21
  • 78
  • 156

1 Answers1

0

I found my answers here UserInfo Dictionaries on CoreData

for (NSString *key in [ei.attributesAsDictionary allKeys]) {
    NSAttributeDescription *attributeDescription = eiEd.attributesByName[key];
    NSString *displayName = attributeDescription.userInfo[@"DisplayName"];
}
Community
  • 1
  • 1
Jeef
  • 26,861
  • 21
  • 78
  • 156