Is there any way I can test if a method exists in Objective-C?
I'm trying to add a guard to see if my object has the method before calling it.
if ([obj respondsToSelector:@selector(methodName:withEtc:)]) { [obj methodName:123 withEtc:456]; }
1.4m articles
1.4m replys
5 comments
57.0k users