Re: Core Data: custom model object accessors vs. KVC
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