Re: Core Data Validation Ignored?
Re: Core Data Validation Ignored?
- Subject: Re: Core Data Validation Ignored?
- From: Andrew Merenbach <email@hidden>
- Date: Tue, 19 Feb 2008 23:10:07 -0800
Ah! Thank you so much, Quincey, for your response. The Validates
Immediately option worked perfectly. :)
Cheers,
Andrew
On Feb 19, 2008, at 10:30 PM, Quincey Morris wrote:
On Feb 19, 2008, at 21:28, Andrew Merenbach wrote:
Despite my searches through the documentation (and despite my
possible incorrectness in assuming that the validation-method
generator will do what I want), I have found no way to get the
table view to validate properly. Furthermore, making a -
(BOOL)validateMyTitleAttribute:(id *)ioValue error:(NSError
**)outError in my NSManagedObject subclass does absolutely nothing.
Actually, the section on validation in the Core Data Programming
Guide seems pretty clear. For example:
It is important to understand that how to validate is a model
decision, when to validate is a user interface or controller-level
decision (for example, a value binding for a text field might have
its “validates immediately” option enabled). Moreover, at various
times, inconsistencies are expected to arise in managed objects and
object graphs.
There is nothing to disallow an in-memory object from becoming
inconsistent on a temporary basis. The validation constraints are
applied by Core Data only during a “save” operation or upon request
(you can invoke the validation methods directly as and when you
wish).
I suspect you just need to turn on the "validates immediately"
option in your bindings in IB. You shouldn't need to write
validate<Key> methods for your properties unless you need additional
customized validation.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden