Obtaining the top-level objects from the main NIB file
Obtaining the top-level objects from the main NIB file
- Subject: Obtaining the top-level objects from the main NIB file
- From: "Arthur C." <email@hidden>
- Date: Fri, 18 May 2007 16:51:30 +0200
Hello,
I'm using a graph-view object (which is an NSView subclass). I have extended
it by adding a category, to implement some extra functions. For one of them
I want to show an NSPanel in which some text can be entered, which is then
saved to file.
As it is a category, I cannot use IBOutlets from the Interface builder (or
is there a way?), as extra instance variables are not allowed. So I'm trying
to obtain the panel object from the NIB file, in which it was created.
It works OK when I save the panel to a separate NIB file and use
NSBundle * aBundle;
[aBundle loadNibFile:@"myNib" externalNameTable:nameTable withZone:nil];
from the Resources Programming Guide. But that won't work for MainMenu.nib,
which is already loaded automatically at program start. If you try to do
that anyway, you get a second copy of your app window on screen.
Is there a way to obtain a reference to the objects in MainMenu.nib, or is
it necessary to use a second file?
Thanks for your time,
Arthur C.
_________________________________________________________________
Talk with your online friends with Messenger
http://www.join.msn.com/messenger/overview
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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