identifying the main app controller
identifying the main app controller
- Subject: identifying the main app controller
- From: Daniel Child <email@hidden>
- Date: Sat, 19 Jan 2008 13:15:51 -0500
Hi All,
I have read everything I thought might help with no luck.
I have a main controller instantiated via MainMenu.nib, and a window
controller used to open another window after closing the first. Once
I have left control of the main app controller and entered the window
controller's code, how can I reference the original controller? For
document apps, I found this:
Every nib file has an owner (FilesOwner). A typical
NSWindowController nib file's owner is a NSWindowController object.
What you should do is subclass NSWindowController, make the
Properties.nib's file owner an instance of your subclass by selecting
the file's owner in InterfaceBuilder, pressing Command-5 and
selecting your subclass in the list. Make sure every user action in
Properties.nib objects sends its message to the nib file's owner,
i.e. to your NSWindowController subclass object. Then edit the action
methods definitions in Xcode or ProjectBuilder. You can always access
the appropriate NSDocument subclass from its NSWindowController by
sending [self document].
I would think there must be an equally easy way to access the main
app controller.
Thanks.
Daniel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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