I would like to have an NSTimer which executes every 1 second and have another NSTimer which executes within that timer slightly less than 1 second.
Actually I am not sure what is the best way to do this, but I would like a random image to appear every second and then disappear after after that second.
So I need some kind of stall or something which can pass the time and then execute the hide button again.
If I set the buttons hidden to TRUE and then set it to FALSE, this appearance time will be so short, how can I stall or make the second pass and then hide the image again?
Thanks in advance
You can try setting yourself into a constant cycle of showing and hiding the object after a specified interval until you interrupt it by using the
performSelector:withObject:afterDelay:method reciprocally in two counter-acting methods:You can interrupt the cycle by putting an
ifstatement which checks some end condition for you around theperformSelector:withObject:afterDelay:call .