Compiler has trouble distinguishing between a class and its superclass
Compiler has trouble distinguishing between a class and its superclass
- Subject: Compiler has trouble distinguishing between a class and its superclass
- From: "Ewan Delanoy" <email@hidden>
- Date: Thu, 22 Mar 2007 11:56:43 +0100 (CET)
- Importance: Normal
Hello all,
in my Cocoa project I have an NSDocument subclass and a NSWindowController
subclass called BZHWindowController. The project compiles fine without any
warnings,
but an exception is raised at runtime. The line that triggers it is the
second of
the two below (which are inside the
windowControllerDidLoadNib: method of the NSDocument subclass):
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
Current language: auto; currently objective-c
(gdb) po wc
<NSWindowController: 0x5adb90>
How can I fix this ?
Ewan
_______________________________________________
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