respondsToSelector

SEL sel = @selector (start:) ; // 指定action  

if ([obj respondsToSelector:sel]) 

{ //判断该对象是否有相应的方法  

[obj performSelector:sel withObject:self]; //调用选择器方法  

}

posted @ 2014-05-23 14:08  ejllen  阅读(170)  评论(0编辑  收藏  举报