• 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: three windows two nibs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: three windows two nibs


  • Subject: Re: three windows two nibs
  • From: Daniel Child <email@hidden>
  • Date: Fri, 18 Jan 2008 20:35:54 -0500

The article indicates that:

"Upon the successful loading a nib file, its contents become ready for you to use immediately. If you configured outlets in your File’s Owner to point to the nib file objects, you can now use those outlets. If you did not configure your File’s Owner with any outlets, you need to retrieve the top-level objects for the nib file at load time. The top-level objects provide the entry points to the entire object graph contained inside the nib file."

Here's the question. In the case of MainMenu.nib, the File's Owner is NSApplication by default. I thought of making my controller a subclass of NSApplication, but that might cause all kinds of unexpected problems. Besides, it's illogical, because the File's Owner needs to exist before the nib loads, and Controller is created when the nib loads, not before. Later in the article:

The File’s Owner of the main nib file is always set to an instance of the NSApplication class. And although you might be able to instantiate a number of custom objects in your main nib file, doing so is hardly practical or necessary.

There must be a way to access that instance of NSApplication. (It seems to be NSApp, a global variable created by +sharedApplication.) But that is still not access to Controller!!!???

Sorry, I simply don't see the answer in that documentation. Maybe enough background allows you to see into the murky depths, but I don't have that kind of vision....

On Jan 18, 2008, at 6:09 PM, mmalc crawford wrote:


On Jan 18, 2008, at 3:03 PM, Daniel Child wrote:

Basically, I am trying to understand how you load nibs and work with window controllers in non-doc apps

<http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/ LoadingResources/CocoaNibs/chapter_3_section_1.html#//apple_ref/doc/ uid/10000051i-CH4-SW8>

mmalc


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: three windows two nibs
      • From: mmalc crawford <email@hidden>
References: 
 >three windows two nibs (From: Daniel Child <email@hidden>)
 >Re: three windows two nibs (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Determining MIME types
  • Next by Date: Re: three windows two nibs
  • Previous by thread: Re: three windows two nibs
  • Next by thread: Re: three windows two nibs
  • Index(es):
    • Date
    • Thread