Hi Gary,
You can provide your own custom validation on the detail view. Here is how to do so:
1. Specify which properties you want to provide custom validation for in your class definition by setting their autoValidate property to FALSE.
...
SCClassDefinition *classDef = [SCClassDefinition definitionWithEntityName:@"My Entity"
withManagedObjectContext:myContext
withPropertyNames:[NSArray arrayWithObjects:@"field1", @"field2", @"field3", nil]];
[classDef propertyDefinitionWithName:@"field1"].autoValidate = FALSE;
...
2. Implement the tableViewModel:valueIsValidForRowAtIndexPath: SCTableViewModelDelegate method, returning TRUE if the cell's value is valid, otherwise return FALSE.
- (BOOL)tableViewModel:(SCTableViewModel *)tableViewModel
valueIsValidForRowAtIndexPath:(NSIndexPath *)indexPath
{
SCTableViewCell *cell = [tableViewModel cellAtIndexPath:indexPath];
if([cell isKindOfClass:[SCTextFieldCell class]])
{
NSString *field1Value = ((SCTextFieldCell *)cell).textField.text;
// your validation code here
...
}
}
Please tell me if this works for you.