• 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: Inheritance question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inheritance question


  • Subject: Re: Inheritance question
  • From: Kai-Mikael Jää-Aro <email@hidden>
  • Date: Fri, 17 Aug 2007 13:17:26 +0200


Tony Wroblewski kirjoitti 2007-08-17 kello 13:02:

It doesn't work because you are still sending the message to your object, even if you cast it. It doesn't work the same as C++, when you can do virtual methods.

Wouldn't [[[myClassInstance] super] theMethod] work, although its incredibly ugly

Perhaps the best would be to do

  if (specialcondition)
     [super theMethod]
  else {
    normalProcessing...
  }

in the child method?


_______________________________________________

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: Inheritance question (From: "Daniel Angermeier" <email@hidden>)
 >Re: Inheritance question (From: Tony Wroblewski <email@hidden>)

  • Prev by Date: Re: When does an object own its instance variable?
  • Next by Date: Re: Inheritance question
  • Previous by thread: Re: Inheritance question
  • Next by thread: Re: Inheritance question
  • Index(es):
    • Date
    • Thread