码迷,mamicode.com
首页 > 其他好文 > 详细

isKindOfClass:和isMemberOfClass:-b

时间:2016-06-16 17:58:29      阅读:137      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!