• 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: Core Data: custom model object accessors vs. KVC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: custom model object accessors vs. KVC


  • Subject: Re: Core Data: custom model object accessors vs. KVC
  • From: Jim Correia <email@hidden>
  • Date: Thu, 25 Jan 2007 16:58:11 -0500

On Jan 25, 2007, at 4:48 PM, Ryan Homer wrote:

(1) Is it ok to use valueForKey: in the custom class instead of primitiveValueForKey: and therefore not use willAccessValueForKey: and didAccessValueForKey:

No. That will cause infinite recursion.

If you implement accessors for modeled properties in your managed object, you must follow the pattern in the documentation.

You can copy the method implementations from the data model editor to get you started. (If you've got a huge number of these to do, Jon Rentzsch's mogenerator may be worth a look.)

Finally, you don't *have* to create accessor methods for all of your properties. It can be helpful because you'll get the compiler to check stuff for you, whereas a typo in a [object setValue: value forKeyPath: @"naem"] may go unnoticed. It is a decision you'll have to make.

Jim


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Core Data: custom model object accessors vs. KVC (From: Ryan Homer <email@hidden>)

  • Prev by Date: Core Data: custom model object accessors vs. KVC
  • Next by Date: Re: Serial key Framework for cocoa?
  • Previous by thread: Core Data: custom model object accessors vs. KVC
  • Next by thread: Mount/Unmount events in Foundation tool
  • Index(es):
    • Date
    • Thread