Duplicate Names in CoreData?

core-data, iphone, objective-c

Solution

Use key value validation (KVV). Add a `-validateName:error:` method to your entity's class. In that method, you can perform a fetch for objects with the same name. If you find any, then the entered name won't be unique in the data store, so return an error.

Problem

In my CoreData object, I have a name attribute, just a string. Is there any automated method or boxes I can tick to stop the user saving a two objects with identical 'name' attributes? Or shall I just check this manually? Thanks.

Original source