Re: Files owner vs MyController
Re: Files owner vs MyController
- Subject: Re: Files owner vs MyController
- From: Ken Tozier <email@hidden>
- Date: Sun, 25 Apr 2004 16:19:12 -0400
On Apr 25, 2004, at 4:01 PM, Ondra Cada wrote:
Ken,
On 25.4.2004, at 21:42, Ken Tozier wrote:
I'm struggling through creating user interfaces for an application
and am completely confused about what Files owners are good for. All
the books I have start by creating a controller class in IB but the
only menu code I've seen so far, seems to interact with the files
owner object. Is it possible for the files owner to also be the
controller class? If so, what's the point of muddying up the works by
creating an unnecessary controller class? My books seem to gloss over
this subject completely.
Depends on the developer: sometimes, you want the controller to be
*inside* the NIB: all the books do just that for it is the simplest
way (let alone using an NSObjectController without writing any code at
all).
On the other hand, in practice sooner or later you bump into a need to
have the controller *outside* the NIB (for example since it should
load more different NIBs on demand, or whatever). That is exactly what
the File's Owner is for.
I think I'm bumping up against the latter. I created a separate nib
file to handle the management of user definable applescript plugins for
my app and have no idea how to go about connecting these independent
nibs to the corresponding menu command in the main nib file. The
separate nibs have their own controller, but when these types of nibs
are created in IB, the resultant files owner object has the same icon
as an instantiated controller class. This is very confusing.
Another related question is that it doesn't seem possible to assign
actions to menu items. Intuitivatively, selecting a menu item is an
action so I would think that when wiring it up to either the controller
or the files owner, that the direction would flow from the menu item to
the controller, but that doesn't seem to be possible.
Ken
_______________________________________________
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.