「objective-c」Javaでクラスを判定するサンプルコード
Javaコード:
f [obj isKindOfClass:[NSString class]]{
[obj …];
}else if([obj respondsToSelect:@selector(shoot:)]){ //no matter what obj is
[obj shoot]; // if obj has shoot method ,it can be excuted
}
//SEL is a type
SEl shootSelecor = @selector(shoot:); <span></span>