• 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: "Daniel Angermeier" <email@hidden>
  • Date: Fri, 17 Aug 2007 12:41:10 +0200

> In the context of MyClass:
> [(MySuperClass *)self theMethod];
>
> However, this call does not invoke MySuperClass's implementation but
> that of MyClass.
> How can force it to use the method in MySuperClass ?

> [super theMethod];

Ok, this would work for that particular case, but what if I have an
instance of MyClass and want to call a super method on it.
[(MySuperClass *)myClassInstance theMethod];
why does this casting approach at compile time not work ?
Is there any other way to force the run time to use the super
implementation of that method ?

Thanks,

Daniel
_______________________________________________

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

  • Follow-Ups:
    • Re: Inheritance question
      • From: Chris Hanson <email@hidden>
    • Re: Inheritance question
      • From: Simone Tellini <email@hidden>
    • Re: Inheritance question
      • From: j o a r <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