// // CCRuntime.m // CCFC // // Created by xichen on 11-12-30. // Copyright 2011 ccteam. All rights reserved. // #import "CCRuntime.h" @implementation CCRuntime // get the var of the obj + (Ivar)getObjVar:(id)obj varname:(const char *)varname ret:(void **)ret { return object_getInstanceVariable(obj, varname, ret); } @end可能有更新:
googlecode链接地址: http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCRuntime.m
googlecode链接地址: http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCRuntime.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCRuntime.m
CCRuntime获取Objective-C实例变量
本文介绍了一个名为CCRuntime的Objective-C类,该类提供了一种方法来获取对象实例变量的值。通过使用object_getInstanceVariable方法,可以实现对指定对象的变量名进行查询并返回其值。
88

被折叠的 条评论
为什么被折叠?



