multiple document windows
multiple document windows
- Subject: multiple document windows
- From: Mark Friedman <email@hidden>
- Date: Mon, 5 Jun 2006 21:59:45 -0400
I have a core data application with two data models. Each model
corresponds to its own document type. Each NSPersistentDocument sub-
class overrides makeWindowControllers to add its own window
controller/windowNib to present the data. New documents of the first
document type listed in info.plist are created with the standard
"New" menu command and this works fine. I added a menu item for the
second type (which appears in info.plist) which targets the following
code:
- (IBAction)newDogDocument:(id)sender {
NSString *typeName = @"Dog Document";
NSDocumentController* documentController;
NSError *error = nil;
NSDocument *aDocument;
documentController = [NSDocumentController sharedDocumentController];
aDocument = [documentController makeUntitledDocumentOfType:typeName
error:&error];
[documentController addDocument:aDocument];
[aDocument makeWindowControllers];
[aDocument showWindows];
}
I can step through this code, watch the variables, and see Nib and
controller names that look correct but no window appears and I get
this message:
[<DogDocument 0x3a5fa0> valueForUndefinedKey:]: this class is not
key value coding-compliant for the key courseDiagramController.
DogDocument is the class of the second document type but
courseDiagramController is the window controller for the first type.
Can anyone tell me what I'm doing wrong?
Mark Friedman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden