views:

50

answers:

2

To animate multiple objects in a view, do we have to use seperate timers for each of the object?

Currently I have four objects for which I am using four timers. How can I do it using a single timer?

Thanks!

+1  A: 

If you are animating at the same time then you should use four timers,else you can use single timer itself.

All the best.

Warrior
If we have 100 such objects, should we use hundred timers? I believe using multiple timers affects battery performance and drains the battery.
PARTH
do you want to animate 100 set of images (1 set=20 frames of images)simultaneously..
Warrior
A: 

If you are animating them all at once within the same time window you can do them together:

[UIView beginAnimations:@"anim1" context:nil];
[UIView setAnimationDuration:0.4];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

object1.frame = newFrame1;
object2.frame = newFrame2;
object3.frame = newFrame3;
object4.frame = newFrame4;

[UIView commitAnimations];
Ben
hey i do not want to use in built animation. Infact i am looking out for a custom animation.So i want to use NSTimer to call the function repeatedly to animate the objects. Please Help. Any Suggestions?
PARTH