[Biococoa-dev] NSMutableData vs malloc

Koen van der Drift kvddrift at earthlink.net
Sun Jul 17 08:45:26 EDT 2005


On Jul 17, 2005, at 8:30 AM, John Timmer wrote:

> I think you want "stringWithUTF8String" or some other method  
> containing
> UTF8.  It's the "modern" equivalent of C strings.
>

Good point, thanks. So we are going with utf8 encoding, then?

Another issue, of course I should have used unsigned char* instead of  
unsigned char. But now the following won't work, because the argument  
for switch is not an int but a pointer:

+ (id) symbolForChar: (unsigned char * )aSymbol
{
     switch ( aSymbol ) {


Any idea how to fix that?


Also, I now need to typecast all these lines:

From:

asparagineRepresentation = [[BCAminoAcid alloc]  initWithSymbolChar:  
'N'];

to

asparagineRepresentation = [[BCAminoAcid alloc]  initWithSymbolChar:  
(unsigned char *) 'N'];


I guess that is unavoidable?

cheers,

- Koen.





More information about the Biococoa-dev mailing list