[Biococoa-dev] initWithUTF8String not working properly

Charles Parnot charles.parnot at gmail.com
Tue Jul 19 17:39:10 EDT 2005

> symbolString  = [[NSString alloc] initWithBytes: aChar length:  
> sizeof(unsigned char) encoding: NSUTF8StringEncoding];
> cheers,
> - Koen.

Don't know about the warning, but the code should be

symbolString  = [[NSString alloc] initWithBytes:&aChar length: sizeof 
(unsigned char) encoding: NSUTF8StringEncoding];

Actually, maybe the warning will go, as the method signature will  
then be different.


NB: and you could safely go with:

symbolString  = [[NSString alloc] initWithBytes:&aChar length:1  

Help science move fast forward:

Charles Parnot
charles.parnot at gmail.com

More information about the Biococoa-dev mailing list