I have an entity in Core Data which has an attribute that needs to be unique. There's no way to set this in the visual interface. I assume I need to create a custom class that inherits from NSManagedObject and then write my own validation method.
I successfully created the custom class by selecting the entities in the visual editor and choosing File -> New -> New File -> NSManagedObject subclass. I use this to add creation timestamps, so I know it works.
But now what? Which methods do I need?
The NSManagedObject reference guide tells me to "implement methods of the form validate:error:" but doesn't provide an example.
Similar questions here and here, but I need a bit more help.
A complete example would be awesome, but any help is much appreciated.