Skip navigation.
 
mlRe: Subclassing Catch-22
FROM : Marco Scheurer
DATE : Tue Apr 26 23:09:56 2005

On Apr 26, 2005, at 22:20, Todd Ransom wrote:

> I never said it was a problem or a bug in Cocoa. I know this is how 
> it's supposed to work.


I'm sorry, but I thought that what you were missing:

>>> I feel like I am missing some simple rule for safely subclassing 
>>> that would prevent this problem.


was just the basics of how super is supposed to work. The question 
does not really make sense otherwise.

> I am asking if anyone knows of a pattern or method that would help 
> me avoid this type of situation.


Without knowing more about what results you were expecting, it's hard 
to be more specific "bad design", or "read the doc". None is very 
helpful if you already read and understood the doc, but that was not 
obvious from your question.

You said:

> In my subclass I would like doSomething to call super for a subset 
> of possible actions. But when I call super it calls [self 
> getInformationRequiredToDoSomething] and returns its own info, not 
> super's.


There's no super's getInformation if there's no [super 
getInformation] written somewhere in your code. Maybe that's what you 
need, maybe, more likely, you need another method, it's hard to tell.

marco


Marco Scheurer
Sen:te, Lausanne, Switzerland  http://www.sente.ch

Related mailsAuthorDate
mlSubclassing Catch-22 Todd Ransom Apr 26, 20:28
mlRe: Subclassing Catch-22 Marco Scheurer Apr 26, 22:05
mlRe: Subclassing Catch-22 Todd Ransom Apr 26, 22:20
mlRe: Subclassing Catch-22 Ondra Cada Apr 26, 22:32
mlRe: Subclassing Catch-22 Greg Titus Apr 26, 22:57
mlRe: Subclassing Catch-22 Marco Scheurer Apr 26, 23:09
mlRe: Subclassing Catch-22 Todd Ransom Apr 26, 23:17
mlRe: Subclassing Catch-22 Marco Scheurer Apr 26, 23:45
mlRe: Subclassing Catch-22 Ondra Cada Apr 26, 23:54
mlRe: Subclassing Catch-22 glenn andreas Apr 26, 23:57
mlRe: Subclassing Catch-22 Todd Blanchard Apr 27, 00:22
mlRe: Subclassing Catch-22 Todd Ransom Apr 27, 00:30
mlRe: Subclassing Catch-22 Ondra Cada Apr 27, 00:36
mlRe: Subclassing Catch-22 Todd Ransom Apr 27, 00:38
mlRe: Subclassing Catch-22 Marco Scheurer Apr 27, 01:03
mlRe: Subclassing Catch-22 Dan Treiman Apr 27, 01:40
mlRe: Subclassing Catch-22 Ondra Cada Apr 27, 01:47