Reputation: 13
I'm fairly new to Objective-C, so forgive me if I'm missing something common. I have a method with several (four) required parameters that needs to run over and over with a delay between runs. Normally, I'd use:
[self performSelector:@selector(methodName:) withObject:nil afterDelay:1.0f/10f];
The problem is I need the method to pass parameters (more than one) back into itself after the delay; but this bit of code can only pass one over. Is there something I'm missing here?
Upvotes: 1
Views: 1274
Reputation: 31323
To answer the actual question, there are generally two ways to use performSelector:withObject:afterDelay:
with multiple pieces of data:
performSelector:withObject:afterDelay:
on the invocation's invoke
method. This method does not require changing any method parameters or adding any methods, but is more verbose.Upvotes: 2