首页 > 其他 > 详细

isKindOfClass:和isMemberOfClass:-b

时间:2016-06-16 17:57:10      阅读:154      评论:0      收藏:0      [点我收藏+]

isKindOfClass:

Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class. (required)

isKindOfClass能确定一个对象是否是一个类的成员,或者是派生自该类的成员

 

 

isMemberOfClass:

Returns a Boolean value that indicates whether the receiver is an instance of a given class. (required)

isMemberOfClass只能确定一个对象是否是一个类的成员

 

例如:

[[NSMutableData data] isKindOfClass:[NSData class]];      // YES

[[NSMutableData data] isMemberOfClass:[NSData class]]; // NO

isKindOfClass:和isMemberOfClass:-b

原文:http://www.cnblogs.com/isItOk/p/5591636.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!