Database Reference
In-Depth Information
} else {
populate ( currentBowtie )
}
}
If there's an error and it happened because the new rating was either too large or
too small, then you present the alert view again. Otherwise, you populate the user
interface with the new rating.
But wait… Where did NSValidationNumberTooLargeError and
NSValidationNumberTooSmallError come from? Go back to the previous console
reading and look closely at the first line:
Could not save Error Domain=NSCocoaErrorDomain Code=1610 "The operation
couldn't be completed.
NSValidationNumberTooLargeError is an enumeration value that maps to the integer
1610. For a full list of Core Data errors and code definitions, you can consult
CoreDataErrors.h in Xcode by Cmd-clicking on NSValidationNumberTooLargeError .
Note: When an NSError is involved, it's standard practice to check the domain
and code for the error to determine what went wrong. You can read more
about this in Apple's Error Handling Programming Guide :
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Er
rorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html
Build and run the app. Verify that the new validation rules work properly by once
again showing the red tie some love:
Search WWH ::




Custom Search