在类继承体系中查询类型信息
isMemberOfClass 能够判断出对象是否为某个特定类的实例
isKindOfClass 判定出对象是否为某类或其子类的实例
例子:
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
BOOL memberDictBool = [dict isMemberOfClass:[NSDictionary class]];//NSLog :NO
BOOL memberMutDictBool = [dict isMemberOfClass:[NSMutableDictionary class]];
// 理论上是YES,在Xcode8.1打印是NO
BOOL kindDictBool = [dict isKindOfClass:[NSDictionary class]];//NSLog :YES
BOOL kindMutDictBool = [dict isKindOfClass:[NSMutableDictionary class]];//NSLog :YES
BOOL kindArrayBool = [dict isKindOfClass:[NSArray class]];//NSLog :NO
DLog(@"MemberNSDictionary:%d---MemberNSMutableDictionary:%d---kindNSDictionary:%d---kindNSMutableDictionary:%d---kindNSArray:%d",memberDictBool,memberMutDictBool,kindDictBool,kindMutDictBool,kindArrayBool);