type的补充还有一些简单说明
type定义参考:https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html 2."v@:@",解释v-返回值void类型,@-self指针id类型,:-SEL指针SEL类型,@-函数第一个参数为id类型 3."@@:",解释@-返回值id类型,@-self指针id类型,:-SEL指针SEL类型, d.注册到运行时环境 objc_registerClassPair(kclass); e.实例化类 id instance = [[kclass alloc] init]; f.给变量赋值 object_setInstanceVariable(instance, "expression", "1+1"); g.获取变量值 void * value = NULL; object_getInstanceVariable(instance, "expression", &value); h.调用函数 [instance performSelector:@selector(getExpressionFormula)];
|