https://github.com/ming1016/study/wiki/Objc-Runtime
先看看isKindOfClass和isMemberOfClass在Object.mm中的实现
- (BOOL)isKindOf:aClass { Class cls; for (cls = isa; cls; cls = cls->superclass) if (cls == (Class)aClass) return YES; return NO; } - (BOOL)isMemberOf:aClass { return isa == (Class)aClass; }
时间: 2024-10-10 18:19:34