Importing Data Easily with MagicalRecord and CoreData

One difficulty I’ve come across when trying to use Magical Record’s MR_importFromObject method, was that the primary key attribute was not my entity name plus “ID”.

And the tags used in the file being imported were also different from my entity attributes.

To indicate which attribute must be considered as Primary Key (since categoryID does not exist), you should select your entity and, in the user info, add a new key “relatedByAttribute” with the attribute value.

If your attribute name is different than the tag used in the file being imported, then you must tell coredata how to do the match.

Share this

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.