FROM : Daniel Child
DATE : Sat Jan 19 19:15:51 2008
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
DATE : Sat Jan 19 19:15:51 2008
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
| Related mails | Author | Date |
|---|---|---|
| Daniel Child | Jan 19, 19:15 | |
| I. Savant | Jan 19, 19:18 |






Cocoa mail archive

