I created a new nib file in my project and in that nib file I need an array controller bound to my app's managed object context. I made an instance of AppDelegate in the nib file and bound to that. The array controller works except that entities added to the array are not being permanently saved to the store. Maybe making a new instance of AppDelegate is not the thing to do. Next, I made File's Owner in the nib file my subclass of NSWindowController. Then I made a managedObjectContext property and in awakeFromNib I set that value with :

managedObjectContext = [[[NSApplication sharedApplication] delegate] managedObjectContext];

I thought that would work but when I instantiate the nib I get this error:

    Cannot perform operation without a managed object context

Maybe the NSArrayController is trying to do its thing before awakeFromNib is called? In any case, that obviously isn't the right way to do it either. Can anyone tell me how to get a reference to my managed object context in my nib file?
Thanks
Mike

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to