• 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: Subclassing Catch-22
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclassing Catch-22


  • Subject: Re: Subclassing Catch-22
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 27 Apr 2005 01:47:55 +0200

Dan,

On 27.4.2005, at 1:40, Dan Treiman wrote:

In respects to the original question, if you really want to get to an overridden method you could cast the target as (MySuperClass *), where MySuperClass is the name of the class whose method is overridden. This is really a C++ish sort of thing to do tho..

Yup. So much C++ish, that it (luckily!) does not do what you think in a decent language :)


Namely: sending a message to an object does not depend at all(*) on the static, compile-time type. Whatever that type is, *always* the proper thing is done -- all the classes, starting with the object's one, are searched for an appropriate method.

(*) save for possible argument and return type casts, but that is completely irrelevant to this debate.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


_______________________________________________
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: 
 >Subclassing Catch-22 (From: Todd Ransom <email@hidden>)
 >Re: Subclassing Catch-22 (From: Marco Scheurer <email@hidden>)
 >Re: Subclassing Catch-22 (From: Todd Ransom <email@hidden>)
 >Re: Subclassing Catch-22 (From: Greg Titus <email@hidden>)
 >Re: Subclassing Catch-22 (From: Todd Ransom <email@hidden>)
 >Re: Subclassing Catch-22 (From: Marco Scheurer <email@hidden>)
 >Re: Subclassing Catch-22 (From: Ondra Cada <email@hidden>)
 >Re: Subclassing Catch-22 (From: Todd Ransom <email@hidden>)
 >Re: Subclassing Catch-22 (From: Marco Scheurer <email@hidden>)
 >Re: Subclassing Catch-22 (From: Dan Treiman <email@hidden>)

  • Prev by Date: Re: Subclassing Catch-22
  • Next by Date: Re: Binding button.enabled to "NSTextField is not empty"
  • Previous by thread: Re: Subclassing Catch-22
  • Next by thread: Re: Subclassing Catch-22
  • Index(es):
    • Date
    • Thread