I’d like to get an array of the attributes for my NSManagedObject so I can use KVO to export them. I can create an array manually and then iterate through it, however, I’d like to get this list automatically, then iterate.
I’d like to get an array of the attributes for my NSManagedObject so I
Share
An NSManagedObject has an entity associated with it. Use NSEntityDescription‘s
-attributesByNameand-relationshipsByName. You’ll get a dictionary back from each of those methods. Just ask the dicts for their-allKeys.