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

Popular posts from this blog

php - How to build a web site which gives a sub-domain dynamically to every registered user? -

Delphi Wmi Query on a Remote Machine -