Re: superclass and awakeFromNib
Re: superclass and awakeFromNib
- Subject: Re: superclass and awakeFromNib
- From: Daniel Zitter <email@hidden>
- Date: Tue, 17 Dec 2002 18:50:23 -0800
Having awakeFromNib called for every object in every NIB, even if it is
a no-op, doesn't seem quite right either, but it is a nice addition to
the list of possible workarounds.
In any event, since the documentation doesn't present a generally
useful solution I have filed a bug--just in case no one else has.
(FWIW, I don't use the code I posted earlier to determine whether or
not to call super for awakeFromNib. You really almost never need to do
it. This is funny to me, since that bucks the conventional wisdom for
implementing methods which may override a superclass's implementation.
But then, awakeFromNib is weird since it is more of an extension of the
NIB than the class.)
While I appreciate the legacy accompanying awakeFromNib, to me, all
this underscores that informal protocols which do not declare default
implementations make bad policy. Formal protocols push the burden to
determine if a superclass implements a given method onto the compiler,
and that is a good thing.
I'd love to hear any comments.
Cheers,
--Dan
On Tuesday, December 17, 2002, at 01:49 PM, John C. Randolph wrote:
I think it would be a lot simpler to just put a NoOp -awakeFromNib in
the root class to keep from hitting an exception, and then go ahead
and call [super awakeFromNib]. No need then to walk the class
hierarchy.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.