I’m setting up my Data Model for Core Data and I’m trying to find out how I can set up an attribute to be unique. I want it so that if another object is about the be saved then it wont allow it if this attribute is the same value as another. How can I do this? Thanks!
Share
As specified in the Validation section of the CoreData guide, you can use the key-valu-coding validation patterns described in the KVC guide. Specifically, in the automatic validation section, it mentions that CoreData will use the KVC validation patterns when it tries to save. So on your model categories, you will end up with something like this: