I building an app dictionary, in this app data of dictionary is json and it will be stored in my server. User buy dictionary, and it will be parsed to coredata. My database structure is have Dictionary(type,name) and table store database dictionary NameDictionary(word, def). Example: User downloaded dictionary en-en, I will have 2 tables in coredata are Dictionary(type,name) and English(word,def), if I get one more dictionary (ex:en-fr) my coredata will be added an table France(word, def). So, my problem is:Could I can create an entity and Model class of this entity dynamically via code
I building an app dictionary, in this app data of dictionary is json and
Share
No you can’t. You can have an entity called
Dictionarieswith 2 attributes:type,nameand another entityDefinitionswith attributes:word,def,typeand add a relationship between the two entities. Then when a user buys a dictionary, you add a new Dictionary with typeen-enand name:"English-English"and then add the definitions for all words for the typeen-en.