Re: @dynamic and Programmatic Access to Setters
Re: @dynamic and Programmatic Access to Setters
- Subject: Re: @dynamic and Programmatic Access to Setters
- From: Mike Rossetti <email@hidden>
- Date: Fri, 18 Apr 2008 09:50:40 -0600
Hah! I believe Paul and Jens have identified the problem! Yes, I am
using [[Tip alloc] init]. I'll rework that portion of the code and
ping back later confirmating the good news.
Thanks guys!
Mike
On Apr 17, 2008, at 11:13 PM, Paul Goracke wrote:
[snip]
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.
On Apr 18, 2008, at 12:21 AM, Jens Alfke wrote:
[snip]
My guess would be that you're not instantiating the object properly.
NSManagedObject does some very, very weird stuff behind the scenes,
including swizzling in fake superclasses. Accordingly, you have to
let the CoreData factory methods instantiate managed objects: just
calling alloc+init won't work.
_______________________________________________
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