• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Obtaining the top-level objects from the main NIB file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Obtaining the top-level objects from the main NIB file (From: "Arthur C." <email@hidden>)

  • Prev by Date: Using bindings with NSPreferencePane
  • Next by Date: Selectable icons in a grid
  • Previous by thread: Obtaining the top-level objects from the main NIB file
  • Next by thread: Using bindings with NSPreferencePane
  • Index(es):
    • Date
    • Thread