at one point of my code I have references to methods as strings and I have their targets. For example, suppose I have an object called myObject and I have a method there called "doSomething:" like this:
- (void)doSomething:(id)sender {
// do something baby
}
at one point of my code I store references to both object and method doing this:
NSString *myMethod = @"doSomething:";
id myTarget = myObject;
later, in another point of the code I want to do this
[myObject doSomething:self];
but how do I reconstruct the method call to that object from an reference id to the object and from a NSString that represents the method and how do I pass self to that method?
thanks
NSSelectorFromString, check the documentation