Quote:
Originally Posted by SkylarEC
SEL yourVariable = @selector(yourSelector  ;
|
Thanks, but I am not sure if I understood that...
My string variable is formed like this...
Code:
// according to x value we will have m1, m2 or m3 as string.
NSString * methodName = [NSString stringWithFormat:@"m%@", x ];
SEL myMethod = @selector(methodName);
// then what?
NSTimer *myTimer = [[NSTimer scheduledTimerWithTimeInterval:0.5
target:self selector:myMethod
userInfo:nil repeats:NO] retain];
[myTimer release];
???? this do not seems to work.
I am receiving an error message telling me that methodName variable is not being used...