• 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: Allocating a C++ class from obj C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allocating a C++ class from obj C


  • Subject: Re: Allocating a C++ class from obj C
  • From: John Draper <email@hidden>
  • Date: Wed, 16 Nov 2005 15:09:07 -0800

Philippe Casgrain wrote:


Le 05-11-15 à 04:51, John Draper a écrit :

Hi,

In my controller....

#import "infoServer.h"

- (id)initWithController:(mySipController *)controller
{
< I do some code - not important here >
mInfoServer = new infoServer(); <---- error: parse before "(" token
}


You don't need the parentheses:

mInfoServer = new infoServer;


why AM I getting this error...  ????????

By the way:  the controller.mm file is set to:  sourcecode.cpp.objcpp
In fact, the file that calls the obj C method - "initWithController"
is also set this way.

Does anyone see what I'm doing wrong?   I've always been able to
mix C++ with Obj C,  but in this case,  nothing I try works....


My other question would have been "Is your file .m or .mm, it needs to be .mm" but you have that covered.

right - but what gets me are all these restrictions when combining it with Obj C classes in same
source module, and X-Code should automatically switch it to "sourcecode-cpp-objc" mode, and
sometimes it doesn't set this, and has been a major "gotcha" in the past.


John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Allocating a C++ class from obj C (From: John Draper <email@hidden>)

  • Prev by Date: AppleGlot vs. IB
  • Next by Date: Re: Allocating a C++ class from obj C
  • Previous by thread: Re: Allocating a C++ class from obj C
  • Next by thread: Subversion and XCode 2.2
  • Index(es):
    • Date
    • Thread