• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
inheritance issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: inheritance issues
      • From: Brent Gulanowski <email@hidden>
  • Prev by Date: scrollRowToVisible and NSTableView
  • Next by Date: NSTextField selectText behaviour (Currency Converter Tut)
  • Previous by thread: Re: scrollRowToVisible and NSTableView
  • Next by thread: Re: inheritance issues
  • Index(es):
    • Date
    • Thread