On Sat, May 9, 2009 at 7:45 AM, Andrew Wood wrote:
> The controllers header file is as follows. As you can see I decalre dbhost
> as a std::string, but dont initialise it.
That is a false statement.
> The initalisation (which crashes) is done in the doLogin action method.
Nope. What happens is
The controllers header file is as follows. As you can see I decalre
dbhost as a std::string, but dont initialise it.
The initalisation (which crashes) is done in the doLogin action method.
#import
#include
@interface CoreController : NSObject
{
//App Windows
IBOutlet NSWin
On Sat, May 9, 2009 at 8:34 AM, 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 vi
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
On Fri, May 8, 2009 at 9:56 AM, Drew Lawson wrote:
> According to Alex Curylo:
>
>>
>> On 8-May-09, at 8:55 AM, cocoa-dev-requ...@lists.apple.com wrote:
>>
>> > mycppstring = std::string([[myNSTextField stringValue] UTF8String]);
>> >
>> >
>> > But it keeps crashing. What's the recommended way?
>>
According to Alex Curylo:
>
> On 8-May-09, at 8:55 AM, cocoa-dev-requ...@lists.apple.com wrote:
>
> > mycppstring = std::string([[myNSTextField stringValue] UTF8String]);
> >
> >
> > But it keeps crashing. What's the recommended way?
>
> I have no idea, but it works for me to simply assign it w
On Fri, May 8, 2009 at 8:39 AM, Alexander Spohr 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
On 8-May-09, at 8:55 AM, cocoa-dev-requ...@lists.apple.com wrote:
mycppstring = std::string([[myNSTextField stringValue] UTF8String]);
But it keeps crashing. What's the recommended way?
I have no idea, but it works for me to simply assign it without the
constructor. Why, here's an example
Probably you can read this document in following link...
http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/Articles/CreatingStrings.html
This talks about how to C string. And after that you can convert that into a
C++ string object.
On Fri, May 8, 2009 at 9:39 PM, Alexander Spohr
That should work.
Where are you crashing - and what is your crash log?
My guess is that something else is not right (are you sure that
myNSTextField is a valid object)?
Jesper Storm Bache
On May 7, 2009, at 2:38 PM, Andrew Wood wrote:
Im using a library which requires arguments to be C++ st
--- On Thu, 5/7/09, Andrew Wood wrote:
> From: Andrew Wood
> Subject: Converting NSString to C++ std::string
> To: Cocoa-dev@lists.apple.com
> Date: Thursday, May 7, 2009, 4:38 PM
> Im using a library which requires
> arguments to be C++ std::strings, but I need to take t
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++).
See the docs:
UTF8String
Returns a null-termi
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
13 matches
Mail list logo