• 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: undocumented "NSNibOwning" informal protocol?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undocumented "NSNibOwning" informal protocol?


  • Subject: Re: undocumented "NSNibOwning" informal protocol?
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Fri, 8 Nov 2002 07:53:47 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Thursday, Nov 7, 2002, at 05:20 US/Eastern, Jirtme Laurens wrote:

Hi,


any object can be the owner of a nib file (used in -[NSWindowController init... owner: object])
apparently, the owner can implement as NSDocument does

windowControllerWill/DidLoadNib:

I suspect [NSWindowController windowWill/DidLoad] asks the owner for such a message despite the doc says "default implementation does nothing"

No, the doc is correct, the NSDocument methods are called by - -[NSWindowController window]. Also, they are not called on the owner of the nib, they are called on the window controller's document.


This is some kind of NSNibOwning informal protocol

Is it safe to rely on such an undocumented behavior?

I'm not sure what you're asking (How could you rely on this behavior without being a subclass of NSDocument?), but this behavior is not undocumented:

From file:///System/Library/Frameworks/AppKit.framework/Resources/ English.lproj/Documentation/Reference/ObjC_classic/Classes/ NSWindowController.html:
- - (NSWindow *)window

Returns the window owned by the receiver or nil if there isn't one. If the window has not yet been loaded, it attempts to load the window's nib file using loadWindow. Before it loads the window, it invokes windowWillLoad in subclass implementations and, if the NSWindowController has a document, it invokes the NSDocument's corresponding method windowControllerWillLoadNib: (if implemented). After loading the window, it invokes windowDidLoad and, if there is a document, the NSDocument method windowControllerDidLoadNib: (if implemented).

See Also: - windowControllerWillLoadNib: (NSDocument)



From file:///System/Library/Frameworks/AppKit.framework/Versions/ English.lproj/Documentation/Reference/ObjC_classic/Classes/ NSDocument.html:
windowControllerDidLoadNib:

- - (void)windowControllerDidLoadNib:(NSWindowController *)windowController

Overridden by subclass to perform any tasks after the receiver's window controller (windowController) loads the nib file containing the document window. The default implementation does nothing.

See Also: - windowControllerWillLoadNib:, - windowControllers


windowControllerWillLoadNib:

- - (void)windowControllerWillLoadNib:(NSWindowController *)windowController

Overridden by subclass to perform any tasks before the receiver's window controller (windowController) loads the nib file containing the document window. The default implementation does nothing.

See Also: - windowControllerDidLoadNib:, - windowControllers


This seems to me to be fairly well documented behavior.

- -- http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iEYEARECAAYFAj3Ls+AACgkQd6STocYT1xVXYgCfQr5ECYf1EssRh4HdfDkhUeI0
5FIAnRgPoppUJtCVWaBt7+pKyk3tziu9
=vDJk
-----END PGP SIGNATURE-----
_______________________________________________
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: undocumented "NSNibOwning" informal protocol?
      • From: Jérôme Laurens <email@hidden>
References: 
 >undocumented "NSNibOwning" informal protocol? (From: Jérôme Laurens <email@hidden>)

  • Prev by Date: Re: To all cocoa developers - new cocoa dev forum
  • Next by Date: Oh, please! (was Re: To all cocoa developers - new cocoa dev forum )
  • Previous by thread: undocumented "NSNibOwning" informal protocol?
  • Next by thread: Re: undocumented "NSNibOwning" informal protocol?
  • Index(es):
    • Date
    • Thread