Re: NSArrayController subclass
Re: NSArrayController subclass
- Subject: Re: NSArrayController subclass
- From: Matt Neuburg <email@hidden>
- Date: Mon, 24 Jul 2006 10:36:40 -0700
- Thread-topic: NSArrayController subclass
On Sun, 23 Jul 2006 17:47:23 +0200, Robert Cerny <email@hidden> said:
>Sorry for your bandwidth,
>I wasn't calling [super awakeFromNib];
I don't think that's a waste of bandwidth at all, since the problem of when
to call [super awakeFromNib] is one of the most vexed in Cocoa. Apple claims
explicitly in the docs at one point that "You do not need to call the super
implementation of awakeFromNib if your class descends directly from a Cocoa
class," but this simple-minded formulation seems wrong; counterexamples
arise sufficiently frequently that this should probably be called a bug in
the docs. In any case, knowing whether super *does* implement it is not
easy, since the docs don't tell you. A common convention (I use here a
formulation I noticed in some code by Mike Ash is):
if([[self superclass] instancesRespondToSelector:_cmd])
[super awakeFromNib];
It might be worthwhile to adopt this convention. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden