Re: Do CoreData validation methods get called for transient attributes?
Re: Do CoreData validation methods get called for transient attributes?
- Subject: Re: Do CoreData validation methods get called for transient attributes?
- From: mmalc crawford <email@hidden>
- Date: Mon, 12 Nov 2007 00:38:38 -0800
On Nov 11, 2007, at 9:06 PM, Dave Fernandes wrote:
Mine doesn't seem to be called ever. Here is the method for the
NSManagedObject subclass that has a transient attribute "duration".
Is this the correct signature?
Yes, and yes.
In your model, did you set the custom class for the entity?
// Validator for duration attribute.
- (BOOL)validateDuration:(id*)ioValue error:(NSError**)error
{
if ([*ioValue doubleValue] > 2.)
{
*ioValue = [NSNumber numberWithDouble:2.];
}
return YES;
}
You are strongly discouraged from modifying the value during validation.
<http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Validation.html#//apple_ref/doc/uid/20002173-169942-CJBHDJGC
>
mmalc
_______________________________________________
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