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

Deixe uma resposta

O seu endereço de email não será publicado. Campos obrigatórios marcados com *

Este site utiliza o Akismet para reduzir spam. Fica a saber como são processados os dados dos comentários.