• 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:10:34 -0800

Adin Hunter Baber wrote:


On 2005 Nov 15, at 3:51 AM, John Draper wrote:

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
}


The "mInfoServer" is an instance variable,  declared as:

    infoServer            *mInfoServer;

In my infoserver.h

class infoServer
{
    public:
       infoServer();

       < A bunch of other things I don't think is relevant >
};

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


John


The line with the error should be:
mInfoServer = new infoServer;

You don't need the ()'s when you create an object with the default constructor.
You only use them when you are passing parameters to a non-default constructor.

And this is permissible when calling it from within an Obj C method? right?

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


  • Follow-Ups:
    • Re: Allocating a C++ class from obj C
      • From: Andy Kim <email@hidden>
References: 
 >Allocating a C++ class from obj C (From: John Draper <email@hidden>)
 >Re: Allocating a C++ class from obj C (From: Adin Hunter Baber <email@hidden>)

  • Prev by Date: Re: Allocating a C++ class from obj C
  • Next by Date: XCode 2.2 can't find framework
  • Previous by thread: Re: Allocating a C++ class from obj C
  • Next by thread: Re: Allocating a C++ class from obj C
  • Index(es):
    • Date
    • Thread