Wednesday, 15 April 2015

ios - UserInfo Dictionaries on CoreData -


What is this part of Apple Core Data Documentation?

User information dictionary

A related object model has many user-related information related to many elements, entities, attributes and relationships as a key-value coupon, Can be added to a user information dictionary. General information to keep the user information in the dictionary includes the details of the version for an entity and the values ​​used by the uniform for the acquired assets.

I understand that the default entities have this dictionary, but I'm not able to find userInfo on Coredata entities or attributes.

get NSEntityDescription from NSManagedObject ( entity Get the NSAttributeDescription via property) or your NSManagedObjectModel and attributesByName. It gives you a dictionary where you get the proper description by name, in which userInfo is also a property.

  NSManagedObject * managedObject; NSEntityDescription * entityDescription = managedObject.entity; NSAttributeDescription * attributeDescription = entityDescription.attributesByName [@ "Some Attribute"]; NSString * foo = attributeDescription.userInfo [@ "foo"];    

No comments:

Post a Comment