multiple nibs question
multiple nibs question
- Subject: multiple nibs question
- From: Eric Wang <email@hidden>
- Date: Wed, 13 Feb 2002 20:36:39 -0500
Hi,
I am trying trying to implement an inspector panel for my app. I need to
connect a menu item in my main nib file to an action method in the inspector
controller class, which is the owner of a secondary nib file. From what I've
read and the Apple source code I've perused, there appear to be two ways to
accomplish this. One way would be to create an instance of the inspector
controller class inside the main nib file and connect the menu items
directly to the controller instance (TextEdit does this for its find panel).
A second way would be to create an app delegate class inside the main nib
file, which would get the shared instance of the inspector controller and
make the appropriate method calls (Sketch does this for its Select Arrow
Tool menu item).
There seem to advantages with each approach. The TextEdit way seems more
direct to me, but I searched the list and read that NSWindowController
subclass instances (my inspector controller is a subclass of
NSWindowController) should be created programmatically rather than in a nib
file. The Sketch way would require the creation of an additional app
delegate class to relay the menu item functions to the inspector controller,
and also the file may start to get unwieldy if I have multiple inspector
panels that I need to connect to.
I'm kind of stuck between the two approaches right now. Can anyone recommend
one approach over the other? It seems kind of strange to me that the two
Apple-supplied examples would differ in their respective approaches. Thanks
for any help you can provide.
Eric Wang
_______________________________________________
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.