Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: does core data always call through the setPrimative methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does core data always call through the setPrimative methods?



On 2011 Jul 24, at 01:46, Roland King wrote:

> does core data implement setFoo: by *always* calling the primitive method, setPrimativeFoo:

Well, it is documented that Core Data's implementation of setFoo: is equivalent to

- (void)setFoo:(id)newValue  {
    [self willChangeValueForKey:@"foo"] ;
    [self setPrimitiveFoo:newValue] ;
    [self didChangeValueForKey:@"foo"] ;
}

There are no branching statements in there.

> or do I need to add the code in both setFoo: and setPrimitiveFoo:?

It's better than either case you've proffered.  I've always put my custom behaviors in setFoo:.  The only time I've ever messed with setPrimitiveFoo: is when debugging.

_______________________________________________

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

References: 
 >does core data always call through the setPrimative methods? (From: Roland King <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.