iOS isKindOfClass 和 isMemberOfC
2020-12-18 本文已影响0人
敬畏CODE
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.
大白话就是:若是调用着是指定类的实例或者是指定类的子类实例就返回YES
isMemberOfClass:
returns YES if the receiver is an instance of the specified class.
大白话:如果调用者是指定类的实例就返回YES(PS:注意不包含子类)