I have CoreData setup in my app and I have an entity with an attribute ‘isSpecial’ boolean. For the records where ‘isSpecial’ is true, I want those records to not be deletable by the user from the UITableView it is displayed within.
So how can I do this? How do I directly see that the cell selected by the user ‘isSpecial’?
You can subclass
NSManagedObjectfor your entity (if you haven’t already), and overridevalidateForDelete:to check theisSpecialproperty of the object.You should also call super’s implementation, as detailed here.
If and when you want to delete it programmatically, you’ll just need to set
isSpecialtoNObefore you attempt the delete.