Re: undocumented "NSNibOwning" informal protocol?
Re: undocumented "NSNibOwning" informal protocol?
- Subject: Re: undocumented "NSNibOwning" informal protocol?
- From: Jérôme Laurens <email@hidden>
- Date: Fri, 8 Nov 2002 16:16:31 +0100
Le vendredi, 8 nov 2002, ` 13:53 Europe/Zurich, Clark S. Cox III a
icrit :
>
[...]
>
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.
Not at all, the windowControllerWillLoadNib messages are sent to the
owner of the nib and not to the window controller's document, and this
is exactly the heart of my question.
This can be proved with 10 lines of code.
>
>
>
>
> 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:
>
the role of the owner in the whole document architecture is
undocumented. I previously thaught that NSDocument was a designated
model controller and NSWindowController was a designated View
controller. It seems that the owner can be a more flexible view
controller because there is no need of subclassing.
_______________________________________________
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.