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: "Michael Ströck" <email@hidden>
- Date: Thu, 22 Mar 2007 12:07:12 +0100
Does the window know which subclass is supposed to handle it? I.e. did
you set the custom class in Interface Builder?
Best,
Micahel
On 3/22/07, Ewan Delanoy <email@hidden> wrote:
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
--
Michael Ströck
Langobardenstraße 9
1220 Wien, AUSTRIA
Phone: +43-676-84556044
Fax: +43-1-2821199-21
_______________________________________________
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