Re: Obtaining the top-level objects from the main NIB file
Re: Obtaining the top-level objects from the main NIB file
- Subject: Re: Obtaining the top-level objects from the main NIB file
- From: Andy Lee <email@hidden>
- Date: Fri, 18 May 2007 11:34:57 -0400
On May 18, 2007, at 10:51 AM, Arthur C. wrote:
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.
Instead of trying to dig it up via the nib, you could make the panel
an outlet of your application delegate, and add a getter method for
it. Then in your category method (or anywhere, for that matter), you
could get to the panel with [[NSApp delegate] myPanel].
_______________________________________________
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