Re: NSArrayController subclass
Re: NSArrayController subclass
- Subject: Re: NSArrayController subclass
- From: Grigory Entin <email@hidden>
- Date: Mon, 24 Jul 2006 22:52:00 +0400
Hi,
Just in case, can you comment on the following solution: just define
(an empty) -awakeFromNib in NSObject category and *always* [super
awakeFromNib] in subclasses?
It sounds a bit like a hack but I prefer it rather than other
solutions. :-)
Regards,
Grigory
On Mon Jul 24 2006 at 21:36, Matt Neuburg <email@hidden> wrote:
> 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.
_______________________________________________
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