NSMutableString to char * - PullRequest
       37

NSMutableString to char *

0 голосов
/ 03 ноября 2011

Горячий я могу преобразовать NSMutableString в char *?

, например

NSString* someval = @"This is a test.";
NSMutableString *temp = [NSMutableSTring stringWithString:someval];
char * temp2 = ????Not sure what to do here???;

1 Ответ

5 голосов
/ 03 ноября 2011

Используйте метод -UTF8String:

NSString* someval = @"This is a test.";
NSMutableString *temp = [NSMutableString stringWithString:someval];
const char * temp2 = [temp UTF8String];
...