• 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: 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?


  • 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

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

  • Prev by Date: Re: NSDocument: Read-only types and autosavesInPlace
  • Next by Date: Re: Xcode 3.2.6 on Lion ?
  • Previous by thread: does core data always call through the setPrimative methods?
  • Next by thread: More on drawRect not getting called
  • Index(es):
    • Date
    • Thread