• 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: Where's the NSWindowController in a default document-based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where's the NSWindowController in a default document-based app


  • Subject: Re: Where's the NSWindowController in a default document-based app
  • From: James DiPalma <email@hidden>
  • Date: Sat, 19 Jun 2004 15:27:40 -0700

On Jun 19, 2004, at 9:54 AM, Izidor Jerebic wrote:
On 18 Jun 2004, at 16:59, Glen Low wrote:
So where does the (default?) NSWindowController come into play?
In simple default single-window-document app, the NSDocument plays the role of window controller, so there is no NSWindowController.

For many years I thought NSWindowController would get lost because it gets allocated automatically and has no nib representation. Just because you don't see an object, doesn't mean its not there (consider NSDocumentController).

In an Xcode default "Cocoa Document-based Application", NSDocuments use an NSWindowController to load their nib file. These window controllers are allocated by -makeWindowControllers:

#0 0x92f017dc in -[NSWindowController initWithWindowNibName:owner:] ()
#1 0x930523b0 in -[NSDocument makeWindowControllers] ()

2. Assuming I make my NSWindowController subclass and wire it into the system, does the NSWindowController then pass responder chain messages back up to the NSDocument (or subclass) or do I have to handle all the messages at the NSWindowController level e.g. save?
No need to change anything. Messages such as "Save" will be handled by appropriate object (NSDocument) just fine...

FYI, full responder chain when a simple textfield is first responder within a document's window (default Xcode document based application):

NSTextView:0xe46bb0
_NSKeyboardFocusClipView:0x1a8120
NSTextField:0x1b01a0
NSView:0x1b00f0
NSWindow:0xe310e0
NSWindowController:0x1abee0
WindowDelegate:0xe36500
NSWindowController:0x1abee0
MyDocument:0x1ab850
NSApplication:0x79130
ApplicationDelegate:0x5efa0
NSDocumentController:0x1878d0



-jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Where's the NSWindowController in a default document-based app
      • From: Izidor Jerebic <email@hidden>
References: 
 >Where's the NSWindowController in a default document-based app (From: Glen Low <email@hidden>)
 >Re: Where's the NSWindowController in a default document-based app (From: Izidor Jerebic <email@hidden>)

  • Prev by Date: Re: Bindings
  • Next by Date: Re: Bindings
  • Previous by thread: Re: Where's the NSWindowController in a default document-based app
  • Next by thread: Re: Where's the NSWindowController in a default document-based app
  • Index(es):
    • Date
    • Thread