• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Do CoreData validation methods get called for transient attributes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • A window that moves on the active space
      • From: 慧 松本 <email@hidden>
    • Re: [SOLVED] Do CoreData validation methods get called for transient attributes?
      • From: Dave Fernandes <email@hidden>
References: 
 >Do CoreData validation methods get called for transient attributes? (From: Dave Fernandes <email@hidden>)

  • Prev by Date: Disabling round corners at the top of a NSMenu
  • Next by Date: Re: troubleshooting unrecognised selector messages
  • Previous by thread: Do CoreData validation methods get called for transient attributes?
  • Next by thread: Re: [SOLVED] Do CoreData validation methods get called for transient attributes?
  • Index(es):
    • Date
    • Thread