Subclass not replacing Superclass

Apprentice
Posts: 14
Joined: 2010.01
Post: #1
Under what conditions does a subclass not replace/override the methods of its superclass, but instead acts as an echo; when a method is called to the subclass object, both the subclass method and same-named superclass method are executed?

I've also seen two (different) subclass objects of one superclass produce the same effect, and it seems to be based on which object is instantiated first. Or something. I'm a bit baffled.
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
If a subclass overrides a superclass method, the superclass method will only be called if the subclass explicitly calls [super nameOfMethodBeingOverridden]. If it doesn't, only the subclass's method is executed. That's all there is to it.
Quote this message in a reply
Apprentice
Posts: 14
Joined: 2010.01
Post: #3
That was it. Thanks.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Subclass access warnings in Objective-C vectorscope 2 4,048 Sep 15, 2009 10:02 AM
Last Post: vectorscope