On Fri, May 8, 2009 at 8:39 AM, Alexander Spohr <a...@freeport.de> wrote: > > Am 07.05.2009 um 23:38 schrieb Andrew Wood: > >> mycppstring = std::string([[myNSTextField stringValue] UTF8String]); >> >> But it keeps crashing. What's the recommended way? > > Does std::string() copy the char* contents? I guess not (but I don’t use > C++).
Yes, it does copy the string. As presented, the OP's code is correct, and should work. OP: You'll have to provide some more information as to what is actually going wrong (especially where the crash is actually happening). -- Clark S. Cox III clarkc...@gmail.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com