• 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: windowcontroller neccessary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: windowcontroller neccessary?


  • Subject: Re: windowcontroller neccessary?
  • From: James DiPalma <email@hidden>
  • Date: Sun, 12 Jan 2003 23:51:47 -0800

From: Mike Ferris <email@hidden>

If you are using NSDocument then the document windows will always have a windowController. For non-document windows, you can do what you like, but NSWindowController is a really good class to start with for your File's Owner.

I prefer allowing an NSDocument subclass to own a document's primary nib file. I think a document instance should own and load a single nib file to initialize an entire document just as an application instance owns and loads a single nib file to initialize an entire application.

From: matt neuburg <email@hidden>

Also NSWindowController is notified when its window loads. m.

A nib instantiated, nib-connected window-delegate would also get notified when its window finished loading: see awakeFromNib.

I tend to avoid subclassing an AppKit object unless I will specifically modify its existing responsibilities. In your case an NSWindowController does imply some control over its window, so subclassing to handle delegate messages does make some sense.

I would recommend against using window controllers as view controllers. Two primary reasons: views may someday move to a new window or a separate nib, and NSWindowController has no inherent responsibility for your window's contents (although, some Cocoa documentation and books recommend/use NSWindowController subclasses).


-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: windowcontroller neccessary?
      • From: Mike Ferris <email@hidden>
  • Prev by Date: Re: Aqua Human Interface and Safari
  • Next by Date: plug-ins and app-updates
  • Previous by thread: Re: windowcontroller neccessary?
  • Next by thread: Re: windowcontroller neccessary?
  • Index(es):
    • Date
    • Thread