objective c - Check if a method exists -
is there way can test if method exists in objective-c?
i'm trying add guard see if object has method before calling it.
if ([obj respondstoselector:@selector(methodname:withetc:)]) { [obj methodname:123 withetc:456]; }
Comments
Post a Comment