Re: Testing background task expiration; lowering backgroundTimeRemaining?
Re: Testing background task expiration; lowering backgroundTimeRemaining?
- Subject: Re: Testing background task expiration; lowering backgroundTimeRemaining?
- From: Manfred Schwind <email@hidden>
- Date: Tue, 13 Jul 2010 21:25:36 +0200
>> is there some way to lower UIApplication's backgroundTimeRemaining property for testing purposes?
>> I want to test the correct behaviour of an App doing some lengthy processing in the background when the background time expires, but I always have to wait 10 Minutes for the timeout ... that's really annoying.
>
> I wonder if you can't get the same effect by killing the background app from within iOS (double tap the Home button, hold down on the icon till it wiggles, touch the (x) button)? My understanding had been that a watchdog kill is no different.
Not quite. I do a lengthy task and I surround it with beginBackgroundTaskWithExpirationHandler and endBackgroundTask so it will continue processing in the background. But, yes, when the task takes too long and the 10 minute timeout expires, the system will usually terminate my app. But when I call endBackgroundTask in the expiration handler, the system will just suspend my app. It does not do any processing anymore, but it's still there (unless resources are needed; the system can kill it anytime, but normally it's still there). When switching back to the app, it just continues processing the task - and I can call beginBackgroundTaskWithExpirationHandler in this case again!
I got this working all fine now; it's pretty cool, but it took me a whole day just for testing all possible situations, fixing code, testing again ... always waiting for the 10 minute timeout ... no fun. ;-)
I bet the Apple engineers internally have a solution to lower the timeout for testing purposes.
Regards,
Mani
--
http://mani.de - friendly software
iVolume - listen to music hands-free
LittleSecrets - the encrypted notepad
Sahara - sand in your pocket
Watchdog - baffle the curious
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden