• 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
Re: Bugs with Obj-C++ compiler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bugs with Obj-C++ compiler


  • Subject: Re: Bugs with Obj-C++ compiler
  • From: Stéphane Sudre <email@hidden>
  • Date: Mon, 12 Nov 2001 11:58:09 +0100

On lundi, novembre 12, 2001, at 10:57 , email@hidden wrote:

CCCObjectPositionController.mm:38: warning: multiple declarations for method `center'
CCCObjectPositionController.mm: In function `':
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:241: warning: using `-(void)center'
CCCObjectPositionController.mm: In function `':
Positionnable.h:35: warning: also found `-(struct Point3D)center'
CCCObjectPositionController.mm: In function `':
Positionnable.h:17: warning: also found `-(struct Point3D)center'
CCCObjectPositionController.mm:38: invalid use of void expression

So the OBj-C++ compiler is confused by another method (from NSWindow) which is completely non-related to my one. Then it CHOOSES THE WRONG ONE, and ends with an error (last line)! So I can't even ignore that...

After a lot of tries, I finally found a way to overcome that:

NSObject<Positionnable>* item = newSelection; // instead of id

does the trick.

Hope this information will be useful to other people with similar difficulties. Note that I still don't understand the rationale behind, so if anyone has an explanation, thanks in advance.

Where is the bug ?

I'm seeing this in Objective-C only. And I don't find this to be a bug but an expected warning.


References: 
 >Bugs with Obj-C++ compiler (From: email@hidden)

  • Prev by Date: Re: Why does TableView not respond to it's inherits methods?
  • Next by Date: Re: New Cocoa Programmer
  • Previous by thread: Bugs with Obj-C++ compiler
  • Next by thread: Re: Bugs with Obj-C++ compiler
  • Index(es):
    • Date
    • Thread