• 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
warning: type `string' has a user-defined constructor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

warning: type `string' has a user-defined constructor


  • Subject: warning: type `string' has a user-defined constructor
  • From: email@hidden
  • Date: Wed, 12 Sep 2007 22:47:28 +0200

Hi

I am using objective-c++ (or .mm files)

In my header file I have defined a std::string variable.

@interface MyStuff : NSObject
{
	std::string myString;
}

When compiling I get the warning: type `string' has a user-defined constructor.

Then in my init method I get a BAD_ACCESS_EXE exception thrown when assigning a value to myString

- (MyStuff *) init {
	myString.assign("123");
}

I can kind of guess that myString constructor has not been called?
What is the correct way of setting this up.

Thanks
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: warning: type `string' has a user-defined constructor
      • From: "Clark Cox" <email@hidden>
    • Re: warning: type `string' has a user-defined constructor
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: Re: NSBrowser background color
  • Next by Date: Re: NSBrowser background color
  • Previous by thread: Re: NSBrowser background color
  • Next by thread: Re: warning: type `string' has a user-defined constructor
  • Index(es):
    • Date
    • Thread