subclassing question
subclassing question
- Subject: subclassing question
- From: Koen van der Drift <email@hidden>
- Date: Sat, 12 Jul 2003 14:31:53 -0400
Hi,
My app has a baseclass with several subclasses. At one point I need to
send a notification to all objects from the subclasses of baseclass.
Because all objects need to get the notification, I made the baseclass
the observer. From there I call the method doSomething which is handled
differently in each subclass (and does nothing in the baseclass):
in baseclass:
- (void)handleNote:(NSNotification *)note
{
float = [[note object] average];
[self doSomething:average];
}
-(void)doSomething:(float)aFloat
{}
in subclass:
-(void)doSomething:(float)aFloat
{
... really do something with float
}
The problem is, only doSomething from the baseclass is called. How can
I make sure that doSomething really gets called in each subclass, not
only in the base class? Maybe each subclass should be an observer
instead of only the baseclass?
thanks,
- Koen.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.