views:

19

answers:

0

I have a very strange problem and I am not sure what is causing it.

I have some animations on my iPhone apps initial view controller. These are basic and are created using this type of code...

[UIImageView beginAnimations:nil context:NULL];
[UIImageView setAnimationDuration:30.0];
[UIImageView setAnimationRepeatCount:1e100f];
[UIImageView setAnimationCurve:UIViewAnimationCurveLinear];

wheel.transform = CGAffineTransformMakeRotation(M_PI*-0.5);
wheelRef.transform = CGAffineTransformMakeRotation(M_PI*0.5);

[UIImageView commitAnimations];

This all works fine, the iPhone can rotate and the views rotate and the animations keep going.

I then have an info button which when the user presses it the view flips over and they are given some preferences (uses presentModalViewController type code).

All this works but a strange thing happens when I exit the preferences and return to the main view. The animations continue to run until I rotate my phone to landscape, the view rotates as expected but all my animations stop.... I have no idea why, I am not getting any errors and no leaks are showing in instruments. Has anyone had anything like this?

Is there a way to see if the animations are still running? Or is there a way I could be canceling them?