I am having problems binding an auxiliary panel with the document's managed object context. The panel is in nib separate from the document nib. My code looks like this.

@interface AuxPanelController : NSWindowController
{
@private
    NSManagedObjectContext *managedObjectContext;
}

@implementation AuxPanelController

- (id)init
{
    if (![super initWithWindowNibName:@"AuxPanel"])
        return nil;
    return self;
}

- (NSManagedObjectContext *)managedObjectContext
{
    return [[self document] managedObjectContext];
}

In the AuxPanel.xib the array controller's managed object context is bound to the File's Owner managedObjectContext model key path. The File's Owner object is the AuxPanelController.

In the running application the auxiliary panel displays properly but an error message is produced: "Cannot perform operation without a managed object context".

Any suggestions?

Richard

_______________________________________________

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