• 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: sending a message from an initializer method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sending a message from an initializer method


  • Subject: Re: sending a message from an initializer method
  • From: Erik Buck <email@hidden>
  • Date: Thu, 13 Jan 2011 17:27:53 -0500

Fair enough.

On Jan 13, 2011, at 1:19 PM, Uli Kusterer wrote:

> On Jan 13, 2011, at 1:27 AM, Erik Buck wrote:
>> Class or instance method makes no difference in this case with regard to polymorphism.
>
> It does. He's only passing the two instance variables to the class method. And, being a class method, "self" is the class, not the half-initialized instance.
>
> So what using a class method does, is it makes it possible for subclasses to change the computation by overriding the method (assuming he's using [[self class] compute:...] to call the class method, and doesn't hardcode the class name). However, since it's a class method, subclasses can't accidentally mess with the half-initialized object.
>
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."
>
>
>

_______________________________________________

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: 
 >Re: sending a message from an initializer method (From: Gordon Apple <email@hidden>)
 >Re: sending a message from an initializer method (From: Erik Buck <email@hidden>)
 >Re: sending a message from an initializer method (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: data over USB to iPhone
  • Next by Date: Maintaining NSCursor outside of app window
  • Previous by thread: Re: sending a message from an initializer method
  • Next by thread: Delegation: should be weak-linked, yet Delegating-Clients... strong linked?
  • Index(es):
    • Date
    • Thread