Re: Newbie Q: equipping an NSDocument subclass with a window controller (2)
Re: Newbie Q: equipping an NSDocument subclass with a window controller (2)
- Subject: Re: Newbie Q: equipping an NSDocument subclass with a window controller (2)
- From: Sherm Pendley <email@hidden>
- Date: Wed, 12 Oct 2005 11:50:03 -0400
On Oct 12, 2005, at 11:17 AM, email@hidden wrote:
I've got a "global controller" class (called AppController) that
deals with
the various controllers inside my project. Among those
controllers, there is a NSDocument subclass (called
BlueDocument).
I'm not entirely sure I follow you. Is AppController a subclass of
NSDocumentController? If not, it shouldn't be dealing with NSDocument
subclasses.
AppController has a method
showBlueWindow like this :
-(void) showBlueWindow {
if (!blueWindow) {
BlueWindow* blueWindow=[[BlueWindow alloc] init];
}
[blueWindow showWindows];
}
Is BlueWindow a subclass of NSDocument? If so, that is *not* how you
create a new NSDocument.
and since I've implemented -makeControllerWindows for this
class BlueWindows (like this, following Sherm's guidelines)
- (void) makeWindowControllers
{
NSWindowController *c = [[[NSWindowController alloc]
initWithWindowNibName: @"BlueWindow" owner:self] autorelease];
[self addWindowController: c];
}
I expected the BlueWindow.nib file to be loaded automatically
when the
blueWindow object is first created.
If BlueWindow is an NSDocument subclass, you're creating and managing
it the wrong way - you should be using NSDocumentController to do that.
Or, if BlueWindow is *not* an NSDocument subclass, then adding a -
makeWindowControllers method to it won't accomplish anything useful.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
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