I am trying to parse many text files and organize their contents as managed objects. There are many duplicates in text files, so one of the โsideโ tasks is to get rid of them.
What I am trying to do in this regard is to check if an entity exists with the given content, and if it is not, I create it. However, I have different objects with different attributes and relationships. What I want is a kind of function that will take several attributes as input and return a new instance of NSManagedObject, and I would not have to worry if it was inserted into or retrieved from the data store.
Is there one?
I must also say that I am noob in the master data.
More details if you want:
I am trying to write a kind of dictionary. I have words (Word {NSString * word, โ Rule of rule}), rules (Rule {NSString name, โ> Word word, โ PartOfSpeech partOfSpeech, <> Endings}), parts of speech (PartOfSpeech {NSString name, โ rule rules)) (I hope the notation is clear).
Two words are equal if they have the same word property and are โconnectedโ to the same rule. Two rules are the same if they have the same endings and part of speech.
, NSPredicate, NSManagedObjectContext NSEntityDescription , , , , , ( ), NSDictionary , , , , .
. , - , . , , .