Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correct way of loading a secondary window of a NSDocument



Hi,

I am trying to figure out the right way to load a "secondary window" as described here in the documentation:
ADC Home > Reference Library > Documentation > Cocoa > Design Guidelines > Document-Based Applications >
"When a secondary window of a document is closed, only that window is closed. The window controller is removed from the document’s list of window controllers. The secondary window and its window controller are released."


The way I do it right now is:
TourWindowController* twc = [[TourWindowController alloc] init];
[twc setHacTour:(HacTour*)[[tourController selection] valueForKey:@"self"]];
[twc showWindow:sender];


[[[NSDocumentController sharedDocumentController] currentDocument] addWindowController:twc];

Where TourWindowController is the "File's Owner" in the associated NIB. But as it seems there is no connection between the document and the window (or TourWindowController). So I guess that's the wrong way to do it. Any pointers to documentation, help on how to load/create a "secondary window" (in the sense described above) is greatly appreciated :).

Thank you,
  Michael _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.