I have to pass number (int) to my next method and I amd trying with next code but with no success:
int myNumber = 45;
[self performSelector:@selector(startNewThing) withObject:myNumber afterDelay:0.5f];
How can I pass number through performSelector?
Here are the changes I’d make to your snippet:
Note that I placed a colon after
-startNewThing. That is so the method can acceptmyNumberas an argument. (This is assuming that -startNewThing: really does take an argument.) And since we’ve changedmyNumberfrom a scalar to an object, you’d need to make the appropriate changes to-startNewThing:.