• 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: Loadable Nib Views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loadable Nib Views


  • Subject: Re: Loadable Nib Views
  • From: Kurt Revis <email@hidden>
  • Date: Thu, 8 Nov 2001 14:38:03 -0800

The documentation on NSBundle Additions tells me how to load
the Nib, but nothing understandable on how to enumerate or access the
objects within it

You need to use the file's owner. The way from the outside of the nib to
get a pointer to an object in a nib is to create an outlet on the file's
owner and connect it to the object you want to get a pointer to.

Yes, but: somehow other classes manage to get at the top-level objects in the nib. Two examples I can think of:

* NSWindowController will release the top-level objects in its nib when it is deallocated
* NSApplication somehow manages to find the main menu, even if there is no connection to it in the application's main nib

I assume the API to do this is private, right? (If so, why?)

(Now that I play around a bit, it's clear that there is something magic about the main menu that's in the nib. I duplicated the main menu and deleted the original one, and my app couldn't find it. Perhaps when the main menu is unarchived, it explicitly calls [NSApp setMainMenu:self], or something.)


References: 
 >Re: Loadable Nib Views (From: Henri Lamiraux <email@hidden>)

  • Prev by Date: Re: Graphics artifacts in NSMatrix
  • Next by Date: Preventing Document-Based App from opening new doc when opened
  • Previous by thread: Re: Loadable Nib Views
  • Next by thread: Re: Loadable Nib Views
  • Index(es):
    • Date
    • Thread