• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArrayController subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: NSArrayController subclass (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Hijacking NSCursor
  • Next by Date: Re: Custom window with small stoplight
  • Previous by thread: Re: NSArrayController subclass
  • Next by thread: Trivial NSTreeController bug: removing leaf nodes with no siblings?
  • Index(es):
    • Date
    • Thread