[Objective C] 获取类和对象的运行时状态

1. -(BOOL) isKindOfClass: <class>
  判断该对象是否为<class>类或其子类的实例

2. -(BOOL) isMemberOfClass: <class>
  判断该对象是否为<class>类的实例

3. -(BOOL) respondsToSelector: <selector>
  判断该对象是否可响应<selector>函数

4. +(BOOL) instancesRespondToSelector: <selector>
  判断该类的实例是否可响应<selector>函数

5. +(BOOL) isSubclassOfClass: <class>
  判断该类是否为<class>类的子类

6. -(id) performSelector: <selector>
  对该对象添加<selector>函数的实现

7. -(id) performSelector: <selector> withObject: <object>
  对该对象添加<selector>函数的实现,并传入<object>参数 ??这个参数干什么用的??

8. -(id) performSelector: <selector> withObject: <object1> withObject: <object2>
  对该对象添加<selector>函数的实现,并传入<object1>和<object2>参数

posted @ 2012-03-05 13:29  linear  阅读(803)  评论(1编辑  收藏  举报