• 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: Sensible way to extend base class?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sensible way to extend base class?


  • Subject: Re: Sensible way to extend base class?
  • From: Michael Ash <email@hidden>
  • Date: Wed, 20 May 2009 12:29:52 -0400

On Wed, May 20, 2009 at 11:40 AM, Jerry Krinock <email@hidden> wrote:
>
> On 2009 May 20, at 08:14, Michael Ash wrote:
>
>> The new -forwardingTargetForSelector: method in Leopard makes this sort of
>> forwarding super easy
>
> Until some months later, when you're debugging a "unrecognized selector sent
> to class B" message.  Ah, three hours later, you realize that the message
> was actually sent to class A but was forwarded to class B.

Trivially avoided by only returning a forwarding target if the target
actually responds to the selector in question.

> All this dynamagic is great when you really need it for a really special
> hack.  But life will be better if, before using it, you carefully consider
> how you might make your great idea fit into a standard design pattern.

Proxying and forwarding *is* a standard design pattern in the ObjC world.

We're using this kooky, obscure, semi-proprietary language for a
reason. Might as well take advantage of what it offers.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Sensible way to extend base class? (From: Graham Cox <email@hidden>)
 >Re: Sensible way to extend base class? (From: Michael Ash <email@hidden>)
 >Re: Sensible way to extend base class? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Sensible way to extend base class?
  • Next by Date: Re: Bindings and KVO of View objects
  • Previous by thread: Re: Sensible way to extend base class?
  • Next by thread: Re: Sensible way to extend base class?
  • Index(es):
    • Date
    • Thread