Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-12-2010, 08:09 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 21
rr299 is on a distinguished road
Default Animations stopping on OS4 after resuming app with multitasking...

Hi so I have an app with a few animations which run continuously. They are very basic and are called using a combination of the commitAnimations style code and the new animation block code (animateWithDuration). All this works fine. I have a preferences view which I can load in and out and my animations run smoothly as I expect.

I just loaded my app onto my new iPhone 4 to test and I have a major problem. When I dismiss the app and reload it (either from the icon on the home page or on the multitasking bar) all the animations stop/crash. I don't get any error messages in my console and I have some timers running which continue as expected. I have tried calling the animation methods again when the app comes back to life but this doesn't work. It's as if everything has frozen. I've spent some time googling this but I can't find a single entry with the same problem, surely I'm not alone??

Has anyone had this problem? Or maybe someone could suggest some ways of overcoming this - I'll give anything I'm a try. I'm pretty new to this so any suggestions would be very useful.

Thanks
rr299 is offline   Reply With Quote
Old 07-12-2010, 03:39 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 21
rr299 is on a distinguished road
Default

Hmm the plot thickens! So I have managed to get my animations to continue after the app has been dismissed to the multitasking tray. To do this I have to reset the initial position when the app comes to life again, like this...

Code:
	wheel.transform = CGAffineTransformMakeRotation(0);
and for completeness this is my animation block...


Code:
[UIView animateWithDuration:30 delay:0.0
 options:(UIViewAnimationOptionAllowUserInteraction |
UIViewAnimationOptionCurveLinear 
|UIViewAnimationOptionRepeat
 )
animations:^(void){
wheel.transform = CGAffineTransformMakeRotation(M_PI*-0.5);
 }
completion:^(BOOL finished){
 if(finished){							  NSLog(@"^^^^^^^^wheel^^^^FINSIHED");
]}
}];
Whilst this is working it isn't perfect because the animation skips back to its start position when the view loads. I guess I can live with it but I'd rather not. Can anyone explain why I have to do this or how I could get around it?

Thanks
rr299 is offline   Reply With Quote
Old 07-20-2010, 03:27 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 21
rr299 is on a distinguished road
Default

Anyone??
rr299 is offline   Reply With Quote
Old 12-06-2011, 10:10 PM   #4 (permalink)
Registered Member
 
Join Date: Dec 2011
Posts: 1
martingale is on a distinguished road
Default Work around

I'm having a similar problem. I was able to overcome this problem by turning off the ability for the app to run in the background by adding the key: "Application does not run in background" and setting it to YES in the info.plist. If your app does not need to run in the background this is not a problem. I believe this is an apple bug.
martingale is offline   Reply With Quote
Reply

Bookmarks

Tags
animations, crash, iphone, os4

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 339
15 members and 324 guests
akphyo, alexP, appservice, cgokey, EXOPTENDAELAX, flamingliquid, guusleijsten, mariano_donati, ohmniac, Paul Slocum, PavelSea, SLIC, Sonuye857, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,653
Threads: 94,115
Posts: 402,888
Top Poster: BrianSlick (7,990)
Welcome to our newest member, ohmniac
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:37 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0