Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Use different window than File Owner's in NIB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use different window than File Owner's in NIB



On Jul 5, 2004, at 3:00 PM, David Bainbridge wrote:

I have a basic question:
I have a window that is displayed by setting the File Owner's custom class setting.

You have a controller (maybe an NSWindowController subclass) acting as File's Owner of a nib file. This object has an outlet to a window and uses that outlet when displaying a window that is in your nib file. This controller must get instantiated outside of your nib file (if you are using NSDocument, you probably subclassed makeWindowControllers) if it is being used as File's Owner. Correct so far?

I have another window that uses the same controller class but has a different layout in the same nib file.

You have a second window in that same nib file. Fine.

I instantiated a new subclass for the controller for the second window but am missing how to have my code use that controller instead of the File Owner's...

Your nib file can have only one File's Owner, so you won't be able to connect both controllers through a single nib load. Even if you loaded this nib twice, you would need to have two outlets to your windows and then somehow choose at runtime which window is your real window.

or in other words how do I simply switch between the two windows from code/IB?

Two nib files? You seem to want both windows loaded at once to allow comparing these two designs; if you copied your nib file and had two versions that had differing layouts, you should be able to load both nib files using two different instances of a single controller class.



-jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Use different window than File Owner's in NIB (From: David Bainbridge <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.