码迷,mamicode.com
首页 > 移动开发 > 详细

iOS --Runtime机制

时间:2016-05-02 23:01:48      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

/**
 运行时(Runtime): 
 * 苹果官方一套C语言库
 * 能做很多底层操作(比如访问隐藏的一些成员变量\成员方法....)
*/
  #import <objc/runtime.h>
  unsigned int count = 0
  Ivar ivars = class_copyIvarList([UITextField class],&count);
  for(int i = 0; i < count; i ++) {
        Ivar ivar = ivars[i]
        NSLog(@"%s",ivar_getName(ivar));
    }
  free(ivars);

 

iOS --Runtime机制

标签:

原文地址:http://www.cnblogs.com/zhangshan/p/5453300.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!