Re: does core data always call through the setPrimative methods?
Re: does core data always call through the setPrimative methods?
- Subject: Re: does core data always call through the setPrimative methods?
- From: Jerry Krinock <email@hidden>
- Date: Sun, 24 Jul 2011 06:11:29 -0700
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