在使用过程当中碰到了 isKindOfClass 和 isMemberOfClass 这两个类,有点好奇。因而search了一下。因而有了下属结论。 html
isKindOfClass: returns YES if the receiver is an instance of the specified class or an instance of any class that inherits from the specified class. app
isMemberOfClass: returns YES if the receiver is an instance of the specified class. code
Most of the time you want to use isKindOfClass: to ensure that your code also works with subclasses. htm
The NSObject Protocol Reference talks a little more about these methods. ci