iOS oc c++混编

//转成c++要的字符串类型
const char * appID =[@"31c210b382c44f3d91a04da33a4e6277" UTF8String];
    const char * appCer =[@"63a777ddf43d4d3bb06e6ec88e5297b3" UTF8String];
    const char * name =[@"ceshiName" UTF8String];
 //用c++ 的字符串类型把返回值接回来
    static std::string key = agora::tools::DynamicKey4::generateMediaChannelKey(appID,appCer ,name, 2882341273u, 1, 0, 0);
//转码成nsstring类型的oc用的字符串
    NSString *ChannelKey= [NSString stringWithCString:key.c_str() encoding:[NSString defaultCStringEncoding]];

你可能感兴趣的:(iOS oc c++混编)