历史冤案之isKindOfClass与isMemberOfClass ``````BOOL res1 = [(id)[NSObject class] isKindOfClass:[NSObject class]];
BOOL res2 = [(id)[NSObject class] isMemberOfClass:[NSObject class]];
BOOL res3 = [(id)[Pluto class] isKindOfClass:[Pluto class]];
BOOL res4 = [(id)[Pluto class] isMemberOfClass:[Pluto class]];
``````

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.

isMemberOfClass: Returns a Boolean value that indicates whether the receiver is an instance of a given class.

``````BOOL res5 = [NSObject class] == [[NSObject class] class];
BOOL res6 = [NSObject class] == [[[NSObject class] class] class];
BOOL res7 = [NSObject class] == object_getClass([NSObject class]);
BOOL res8 = object_getClass([NSObject class]) == object_getClass(object_getClass([NSObject class]));
BOOL res9 = [NSObject class] == class_getSuperclass(object_getClass([NSObject class]));
``````

``````+ (BOOL)isMemberOfClass:(Class)cls {
return object_getClass((id)self) == cls;
}

- (BOOL)isMemberOfClass:(Class)cls {
return [self class] == cls;
}

+ (BOOL)isKindOfClass:(Class)cls {
for (Class tcls = object_getClass((id)self); tcls; tcls = class_getSuperclass(tcls)) {
if (tcls == cls) return YES;
}
return NO;
}

- (BOOL)isKindOfClass:(Class)cls {
for (Class tcls = [self class]; tcls; tcls = class_getSuperclass(tcls)) {
if (tcls == cls) return YES;
}
return NO;
}
``````

PS:具体代码可以从Github上获取。
{"ft_lang_label":"__label__zh","ft_lang_prob":0.56747776,"math_prob":0.89088094,"size":2881,"snap":"2019-26-2019-30","text_gpt3_token_len":1620,"char_repetition_ratio":0.21202642,"word_repetition_ratio":0.18410042,"special_character_ratio":0.2044429,"punctuation_ratio":0.115384616,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9885047,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-06-25T12:08:06Z\",\"WARC-Record-ID\":\"<urn:uuid:ae3d604a-f1e2-4368-b462-abc4e892738a>\",\"Content-Length\":\"16073\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3cff3619-288a-4e23-aecd-431810fb947a>\",\"WARC-Concurrent-To\":\"<urn:uuid:ee3fface-eead-4257-b4ce-cc915238e12c>\",\"WARC-IP-Address\":\"139.162.106.116\",\"WARC-Target-URI\":\"http://www.nscookies.com/runtime-objectmodel/\",\"WARC-Payload-Digest\":\"sha1:IGT7RTPD4IUHOLDL5ZGLWJXKN373XYU3\",\"WARC-Block-Digest\":\"sha1:MZFITH5O6NJUJOWR63CUUX7TVBQ32QG3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-26/CC-MAIN-2019-26_segments_1560627999838.23_warc_CC-MAIN-20190625112522-20190625134522-00100.warc.gz\"}"}