xcode - iPhone SDK: Setting up an animation to create a blinking effect -


In an iPhone application I am developing, I have an image view that displays the eyes and I want to wink them. I am a clearly blinking one random thing, it can not be regular and will keep repeating like a UIImageView animation will be repetitive.

How do I set up an animation that displays a frame (blinking eyes), then sets back to the original image and does it in random intervals?

You can use an NSTimer. The timer's representative method has changed the image of the eye to a blink image, and then set the timer's fire date at a random time.
Once the anestimer has been removed, use this code to set it at a random time:
[your timer setfidet: [date of the NSDT date time interval: now: rand ()% maxTimeBetweenBlinks]] ; With the right prices, instead of replacing your timer and maxtimebubbleinblocks, obviously - you probably have SRend (time) (zero) generator


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -