-updated code-
-(void)animateDot {
dotMotion.center = (*doodlePoints)[0];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationRepeatCount:100];
for(int i = 1; i < doodlePoints->size(); i++){
dotMotion.center = (*doodlePoints)[i];
}
[UIView commitAnimations];
}
I have a vector of points and I want this to do the animation from point to point. I am only getting from the 2nd to the last to the last working. not anything before.
Any ideas?
So i tried doing this differently. Nothing.
My application has to work 3.x so i can’t use animation blocks.
Even better try the following:
This is a rough example of loading the individual points in an NSMutableArray property that is incrementally processed and emptied as each animation completes. You could just as easily use an internal index property to the doodlePoints array but I did it this way should you ever need to pass in a different collection of points. In my example we set the animation delegate and callback selector so we can be told about each animation completing. We then schedule the an animation to the next point and remove it from the array.