Re: Compiler has trouble distinguishing between a class and its superclass
Re: Compiler has trouble distinguishing between a class and its superclass
- Subject: Re: Compiler has trouble distinguishing between a class and its superclass
- From: "Tom Harrington" <email@hidden>
- Date: Fri, 23 Mar 2007 11:50:50 -0600
On 3/22/07, Ewan Delanoy <email@hidden> wrote:
BZHWindowController* wc=[self theOnlyWindowController];
[wc setTitleMustBeLocalized: (![self fileURL])];
The error message goes, [NSWindowController setTitleMustBeLocalized:]:
selector not recognized [self = 0x529a00]
Now it is admittedly true that the class NSWindowController does not
have a method
"setTitleMustBeLocalized:" ; however, my subclass BZHWindowController
does. It seems
that the compiler doesn't really know if the wc instance is a
NSWindowController or a
BZHWindowController, from what the debugger says :
(gdb) p wc
$1 = (class BZHWindowController *) 0x5adb90
The above is just telling you that you have declared wc to be a
pointer to BZHWindowController, which is obvious from the code you
posted. It doesn't tell you anything about what's in the object.
Current language: auto; currently objective-c
(gdb) po wc
<NSWindowController: 0x5adb90>
The above tells you what wc actually is, which is what [self
theOnlyWindowController] returned.
So the real question is, what is happening in [self
theOnlyWindowController]? Apparently it's returning an
NSWindowController, not a BZHWindowController, and you need to find
out why.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden