Re: NSManagedObject class method error
Re: NSManagedObject class method error
- Subject: Re: NSManagedObject class method error
- From: Chris Hanson <email@hidden>
- Date: Mon, 8 Oct 2007 09:15:06 -0700
On Oct 8, 2007, at 8:40 AM, ad veloper wrote:
+ (Foo *)fooWithDefaultContext
{
return [NSEntityDescription insertNewObjectForEntityForName:@"Foo"
inManagedObjectContext:[[NSApp delegate]
managedObjectContext]];
}
Are you sure that at the time this method is invoked, [NSApp delegate]
returns a fully-configured delegate, and that delegate can return its
managed object context?
If you're invoking this before your main nib file is loaded, and
that's where your application's delegate is configured, that would
explain what you're seeing.
-- Chris
_______________________________________________
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