inheritance issues
inheritance issues
- Subject: inheritance issues
- From: Francisco Tolmasky <email@hidden>
- Date: Thu, 16 Jan 2003 21:31:29 -0800
OK, I'm having some inheritance issues.
I have a class named docmanager like this:
@interface docmanager: NSObject
{
...
}
...
-(NSString *)description;
@end
and then a class that inherits from it called "JavascriptManager":
@interface JavascriptManager: docmanager
{
...
}
- (NSString *)description;
@end
description for docmanager returns @"unspecified file" and
javascriptmanager's description returns @"javascript file"
Now, I have an instance of docmanager my NSDocument subclass:
@interface myDocument: NSDocument
{
DocumentManager *myManager;
}
...
@end
Then, later on, I initialize it like this if the file opened is a
javascript file:
myManager= [[JavascriptManager alloc] init];
but when I call [myManager description] it still returns @"unspecified
file". I'm new to Objective-C, I know in C++ though this would simply
need to be declared as a virtual function so it can be overrided with
an inherited pointer. But how do I do it in Objective-C? Or, what am
I doing incorrectly now?
_______________________________________________
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.