• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDocument and makeWindowControllers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSDocument and makeWindowControllers (From: email@hidden)

  • Prev by Date: Returning an NSDictionary/record to AppleScript command
  • Next by Date: IB layout
  • Previous by thread: NSDocument and makeWindowControllers
  • Next by thread: Returning an NSDictionary/record to AppleScript command
  • Index(es):
    • Date
    • Thread