I was just wandering If there is a simplier method to repeat the codes below for 20 seconds. If there is, how?
[self performSelector:@selector( move1) withObject:nil afterDelay:0.0];
[self performSelector:@selector( move2) withObject:nil afterDelay:0.2];
[self performSelector:@selector( move3) withObject:nil afterDelay:0.4];
[self performSelector:@selector( move1) withObject:nil afterDelay:0.8];
[self performSelector:@selector( move2) withObject:nil afterDelay:0.10];
[self performSelector:@selector( move3) withObject:nil afterDelay:0.12];
According to my opinion Just try this code below,
Take one NSInteger in your Controller’s .h file, like this,
then in .m file Call NSTimer method like this,
And write selector like this
From above code, testMethod will call 20 times and according to your requirement your code will repeat 20 times..
Hope It works for you.
Happy coding..