I’ve got a timer
myTimer = [NSTimer scheduledTimerWithTimeInterval:x target:self selector:@selector(timerAction:) userInfo:[NSDictionary dictionaryWithObjectsAndKeys:y, @"y", z, @"z", nil] repeats:YES];
and method:
-(void)timerAction:(NSTimer *)theTimer {
SomeObject *y = [[theTimer userInfo] objectForKey:@"y"];
SomeObject *z = [[theTimer userInfo] objectForKey:@"z"];
{etc...}
NSLog(@"Done");}
Now my question is how to call the method directly? I need to turn it on immediately not only after x time passed, so i wanted to call it. However this method returns crash([__NSCFDictionary userInfo]: unrecognized selector sent to instance):
[self performSelector:@selector(timerAction:) withObject:[NSDictionary dictionaryWithObjectsAndKeys:y, @"y", z, @"z", nil]];
you can do this,