sponsored links

关于 NSString 与 string 互相转换

NSString -> string

String str =[aNSString UTF8String];  //aNSString是NSString的值

String -> NSString

NSString * nss = [NSString stringWithUTF8String:str.c_str()];

Tags: