Subclass not replacing Superclass
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.
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.
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.
That was it. Thanks.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Subclass access warnings in Objective-C | vectorscope | 2 | 3,521 |
Sep 15, 2009 10:02 AM Last Post: vectorscope |
|

