I have an object in Core Data that has an attribute that must be unique. It is not possible to set this in the visual interface. I assume that I need to create my own class that inherits from NSManagedObject, and then write my own validation method.
I successfully created a custom class by selecting objects in the visual editor and choosing File → New → New File → Subclass NSManagedObject. I use this to add creation timestamps, so I know this works.
But what now? What methods do I need?
The NSManagedObject reference manual tells me to "implement validate: error: form methods," but does not provide an example.
Similar questions here and here , but I need more help.
A complete example would be awesome, but any help is greatly appreciated.
Sjors provoost
source share