Re: undocumented "NSNibOwning" informal protocol?
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.