标签:turn color 共同点 value font 含义 方法 people style
- (void)viewDidLoad { [super viewDidLoad]; People *people = [[People alloc] init]; Student *student = [[Student alloc] init]; if ([people isKindOfClass:[People class]]) { NSLog(@"people iskinofclass People"); } if ([people isKindOfClass:[NSObject class]]) { NSLog(@"people iskinofclass NSObject"); } if ([student isMemberOfClass:[Student class]]) { NSLog(@"student ismemberOfClass People"); } if (![student isMemberOfClass:[NSObject class]]) { NSLog(@"student isbelog NSObject"); } }
BOOL rez1 = [(id)[NSObject class] isKindOfClass:[NSObject class]]; BOOL rez2 = [(id)[NSObject class] isMemberOfClass:[NSObject class]]; BOOL rez3 = [(id)[Student class] isKindOfClass:[People class]]; BOOL rez4 = [(id)[Student class] isMemberOfClass:[Student class]];
OC中isKindOfClass与isMemberOfClass的区别
标签:turn color 共同点 value font 含义 方法 people style
原文地址:http://www.cnblogs.com/xiaofengfengzhang/p/6567529.html