• 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: Chris Hanson <email@hidden>
  • Date: Fri, 17 Aug 2007 14:13:12 -0700

On Aug 17, 2007, at 3:41 AM, Daniel Angermeier wrote:

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.

The thing to remember is that you're not calling a method on an instance of a class. You're sending a message to an instance of a class. What the instance does with that message is up to it; typically the runtime calls a method to deal with it, though there are other ways an instance can deal with a message that are entirely transparent to the sender. (Take Distributed Objects proxies for example, or -forwardInvocation:.)


If an instance of a class wants to handle a particular message, chances are that you should let it handle the message rather than try to second-guess it. You never know what invariants you may otherwise cause it to violate otherwise.

  -- Chris

_______________________________________________

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>)

  • Prev by Date: Re: modifying info dictionary
  • Next by Date: How to use Automator workflows in a Cocoa application?
  • Previous by thread: Re: Inheritance question
  • Next by thread: Re: Inheritance question
  • Index(es):
    • Date
    • Thread