• 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
Compiler has trouble distinguishing between a class and its superclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Compiler has trouble distinguishing between a class and its superclass
      • From: "Tom Harrington" <email@hidden>
    • Re: Compiler has trouble distinguishing between a class and its superclass
      • From: "Michael Ströck" <email@hidden>
  • Prev by Date: Re: imageNamed cannot load an image
  • Next by Date: Re: Compiler has trouble distinguishing between a class and its superclass
  • Previous by thread: Re: sending image through network
  • Next by thread: Re: Compiler has trouble distinguishing between a class and its superclass
  • Index(es):
    • Date
    • Thread