用NSValue封装C或C++的对象(结构…
来源:互联网 发布:淘宝差评多长时间生效 编辑:程序博客网 时间:2024/05/16 11:08
假设存在对象:
class testClass
{
public:
string myCode;
}
封装示范代码:
testClass* test = new testClass();
test.myCode = "Hello NSValue";
NSValue* value = [NSValue valueWithBytes:(voide*)testobjcType:@encode(testClass)];
return value;
解封示范代码:
testClass* testRecive = new testClass();
[value getValue:testRecive];
printf("%s",testRecive.myCode.c_str());
用途:
用来把C/C++的对象(结构体)封装成objC的对象NSValue,便于在objC调用,以及使用NSArray、NSDictonary等数据结构传递。
class testClass
{
public:
string myCode;
}
封装示范代码:
testClass* test = new testClass();
test.myCode = "Hello NSValue";
NSValue* value = [NSValue valueWithBytes:(voide*)testobjcType:@encode(testClass)];
return value;
解封示范代码:
testClass* testRecive = new testClass();
[value getValue:testRecive];
printf("%s",testRecive.myCode.c_str());
用途:
用来把C/C++的对象(结构体)封装成objC的对象NSValue,便于在objC调用,以及使用NSArray、NSDictonary等数据结构传递。
0 0
- 用NSValue封装C或C++的对象(结构…
- NSNumber和NSValue对基础C数据类型的对象化封装
- NSValue封装自定义的结构体
- Objective-C--- NSValue 详解 struct 结构体
- 用NSNumber和NSValue基本数据类型和结构体的封装
- NSValue对任何结构体,基本类型,指针的封装
- Objective-C中NSValue的使用
- Objective-C中NSValue的使用
- Objective-C 中的NSValue的详解
- Objective-C中NSValue的使用
- Objective-C中NSValue的使用
- Objective-C中的NSValue的详解
- object-c 中NSValue的解析
- Objectiv-C NSValue类的常用方法
- Objective-C 中的NSValue的详解
- 如何使用NSValue 类型包含C结构体
- Objective-C基础之NSValue包装结构体
- Objective-C 【NSValue】
- Python学习笔记-闭包
- AIDL简介
- MAC下配置php基本步骤
- 在nas机上配置svn(mac)
- 关于对设计模式与代码规范的…
- 用NSValue封装C或C++的对象(结构…
- 去掉Git中不希望再追踪的文件
- 20160225.CCPP体系详解(0035天)
- 权限命令
- 洗牌算法
- group
- 2016.03.20(pio,都忘了,跟没有嘴一样)
- “程序段”注释方法
- 安装apahce2+phpmyadmin