Re: Converting NSString to C++ std::string

2009-05-10 Thread Andrew Wood
May 2009, at 13:34, Andrew Wood wrote: Investigated it a bit further. It works if I declare the string in the method where Im doing the assignment, but what I was trying to do, and really need to do, is decalre the std::string in the app controllers header file, so that its visible to all

Re: Converting NSString to C++ std::string

2009-05-09 Thread Andrew Wood
Investigated it a bit further. It works if I declare the string in the method where Im doing the assignment, but what I was trying to do, and really need to do, is decalre the std::string in the app controllers header file, so that its visible to all methods in the controller, then do the

Converting NSString to C++ std::string

2009-05-08 Thread Andrew Wood
Im using a library which requires arguments to be C++ std::strings, but I need to take the value from an NSTextField. I thought I could do it like this: std::string mycppstring; . . . mycppstring = std::string([[myNSTextField stringValue] UTF8String]); But it keeps crashing. What's the rec