Re: NSDocument and makeWindowControllers
Re: NSDocument and makeWindowControllers
- Subject: Re: NSDocument and makeWindowControllers
- From: "Scotty's Lists" <email@hidden>
- Date: Sun, 10 Dec 2006 13:38:31 -0500
Jim,
All the magic is done by NSDocumentController. You might want to
consider just making your app document-based, especially since you're
already using NSDocument. You're 2/3 of the way there...maybe even
7/8ths.
From the NSDocument docs on makeWindowControllers:
This method is called by the NSDocumentController open... methods,
but you might want to call it directly in some circumstances.
From NSDocumentController's doc:
In some situations, it is worthwhile to subclass
NSDocumentController in non-NSDocument-based applications to get
some of its features. For example, the NSDocumentController
management of the Open Recent menu is useful in applications that
don’t use subclasses of NSDocument.
I looked all this up using Appkido, a great browser for Apple Cocoa
docs.
<http://homepage.mac.com/aglee/downloads/appkido.html>
If you haven't seen Appkido yet, you might download it and give it a
look. I've found that it makes it fairly pleasant to look through
Cocoa docs.
To be fair, though, I also knew where to look in the docs.
Scotty
On Dec 10, 2006, at 1:02 PM, email@hidden wrote:
I am trying to get a seperate Nib file which contains a window to
display. I chose, maybe not correctly to use the well documented
approach of subclassing NSDocument and WindowController.
The nib I built ( and this is all in Project Builder 10.2 ) will
load appears to work only if I directly make the call to force the
makeWindowControllers fire on the init of the NSDocument subclass.
It looks like this
- (id)init
{
self = [super init];
if (self) {
[self makeWindowControllers];
}
return self;
}
From what I have seen in code examples, nobody has to do this.
When I look at all the attached nibs, there outlet, file owners,
and actions, everything is completely fine. the one caveat is that
the Cocoa application is not a Document Based app.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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