[Biococoa-dev] initWithUTF8String not working properly

John Timmer jtimmer at bellatlantic.net
Tue Jul 19 07:53:25 EDT 2005


> On Jul 18, 2005, at 8:26 PM, Koen van der Drift wrote:
> 
>> I have updated the project and also changed the symbolString init to:
>> 
>>         symbolString  = [[NSString alloc] initWithUTF8String:
>> (const char *) &aChar];
> 
> 
> Hmm - this line now sometimes returns nil when initializing the
> symbols causing a crash later on. I am out of ideas right now (and
> off to work) , anyone has a chance to look into it?

Ah, you're handing it a character, not a zero-terminated string.  Try
"initWithBytes:length:encoding" using " NSUTF8StringEncoding"

JT


_______________________________________________
This mind intentionally left blank





More information about the Biococoa-dev mailing list