I would like to save in a variable the address of a static method and then call it when it interests as if it were a function pointer in C.
How would it be implemented in Objective C? Would it work the same for non-static methods?
I would like to save in a variable the address of a static method and then call it when it interests as if it were a function pointer in C.
How would it be implemented in Objective C? Would it work the same for non-static methods?
You only have to create a selector pointing to the static method of the class
Class class = NSClassFromString(@"NombreDeLaClase");
SEL selector = NSSelectorFromString(@"nombreDelMetodo");
Then to call it you just have to perform a selector
[class performSelector:selector];