Re: @dynamic and Programmatic Access to Setters
Re: @dynamic and Programmatic Access to Setters
- Subject: Re: @dynamic and Programmatic Access to Setters
- From: Paul Goracke <email@hidden>
- Date: Thu, 17 Apr 2008 22:13:46 -0700
On Apr 17, 2008, at 8:47 PM, Mike Rossetti wrote:
Yes, that's my understanding. But according to the comments I
mentioned in my earlier message, Core Data provides the
implementations. And clearly it does since I can edit, save and
restore the document.
But you're doing all that via bindings, which uses KVC but doesn't
require accessor methods. So "it works" does not imply that the
accessors were synthesized.
I'm just missing the 'magic' that tells me how to set/get a
property being managed by Core Data.
I think the problem is in your creation of the Tip NSManagedObject--
you can't simply call [[Tip alloc] init] and have it work. Create your
object via "[[NSManagedObject alloc] initWithEntity:@"Tip"
insertIntoManagedObjectContext:[self managedObjectContext]]" or
"[NSEntityDescription entityForName:@"Tip" inManagedObjectContext:
[self managedObjectContext]]" and it should work as expected.
I'm pretty sure the property accessors are being synthesized; you're
just not creating an object that can be recognized as the proper type
to determine whether it responds to that selector.
See <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdCreateMOs.html#//apple_ref/doc/uid/TP40001654-213474
> for further information.
pg
_______________________________________________
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