I am trying to fine-tune my CoreData entity validation. I have a new object that is presented in an STV detail view, with 6 properties that need to all have values filled in before the object can be saved (by pressing the generated UIBarButtonItem "Done" in this case). I was able to accomplish that by marking those propertyDef's with required = TRUE. I now need to add additional validation. The 6 properties are grouped into 2 sections of 3 properties:
All properties are defined in CoreData as int16. I need to prevent the "Done" button from being enabled if the sum of either section is over 100. I tinkered with using cellActions.valueIsValid but I don't think this will work because if I return FALSE from this block, while it will prevent the "Done" button from being enabled, it will also prevent the value from committing to the bound object. Normally that would be fine, but since I have 3 cells that are basically "linked" together, it could cause the object to NEVER be valid. Basically I'm looking for a .entityIsValid or .objectIsValid equivalent so I can evaluate the presented object as a whole, rather than the individual properties.
Anyone have ideas on how to accomplish this? I'm thinking I may need to subclass SCTableViewController and handle the doneButton.