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

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -