oc 类型判断
#import <UIKit/UIKit.h> #import "AppDelegate.h" @interface A : NSObject @end @implementation A @end @interface AA : A @end @implementation AA @end @interface B : NSObject @end @implementation B @end int main(int argc, char * argv[]) { A *a=[[A alloc]init]; NSLog(@"%d",[a isKindOfClass:[B class ] ]);//返回值1表示是这个类型,0不是这个类型 }