第一种:runtime.h里的方法BOOL class_addProperty(Class cls, const char *name, const objc_property_attribute_t *attributes, unsigned int attributeCount...
分类:
移动开发 时间:
2015-12-26 13:28:49
阅读次数:
178
看过一些第三方开源类库的源代码,经常发现他们 给一个 类 添加了一个原本不存在的属性,
比如PPrealSideController 就给 UIViewController添加了一个 self.pprealSideController的属性?
他是如何实现的呢?
1.基本的实现思路
首先我们需要了解,实际上 在我们使用 类似于self.newProperty的语句的时候,...
分类:
移动开发 时间:
2015-04-23 13:20:30
阅读次数:
167
原文链接http://blog.csdn.net/meegomeego/article/details/18356169第一种:runtime.h里的方法BOOL
class_addProperty(Class cls,constchar*name,constobjc_property_attrib...
分类:
移动开发 时间:
2014-05-28 02:59:54
阅读次数:
279