C/C++和Objective-C混合编程时一些有用的代码片段
NSString和std::string的相互转换 std::string to NSString std::string str = testStr(); NSString* ns = [NSString stringWithCString:str.c_str() encoding:NSUTF8StringEncoding]; NSString to std::string NSString *str = @"it is nsstring"; std::string str = std::string([str UTF8String]);……