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 06-13-2011, 04:37 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Location: New York
Posts: 18
TheStuFactor is on a distinguished road
Default Can I force an 'applicationWillTerminate' after my background tasks finish?

Just a quick question to find out if this is even possible:

I want my app to run in the background for a given period of time (5-minutes). After which, I want to force a termination of the app.

Can I force an 'applicationWillTerminate' in the background or do I have to encapsulate my 'init' logic and do it manually when it comes back from the background?
TheStuFactor is offline   Reply With Quote
Old 06-13-2011, 04:55 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Don't ever force termination of the app.

At any rate, applicationWillTerminate is simply a notification handler. It doesn't in any way cause the app to terminate. It's just a heads up from the OS.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 06-13-2011, 05:06 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Paris, France
Posts: 946
7twenty7 is on a distinguished road
Default

Quote:
Originally Posted by dljeffery View Post
Don't ever force termination of the app.

At any rate, applicationWillTerminate is simply a notification handler. It doesn't in any way cause the app to terminate. It's just a heads up from the OS.
Right, and if the OP wants to just make sure the app appears to start from scratch when it comes back to the foreground if it's been more than 5 minutes, just save the time when you're backgrounded, and when you come back to being active, just do the right setup to start from the beginning.
7twenty7 is offline   Reply With Quote
Old 06-14-2011, 12:13 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2011
Location: New York
Posts: 18
TheStuFactor is on a distinguished road
Default

Cool thanks! appreciate the help!
TheStuFactor is offline   Reply With Quote
Reply

Bookmarks

Tags
background, multitasking, terminate

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: 308
6 members and 302 guests
chemistry, Dnnake, iOS.Lover, lendo, Leslie80, pbart
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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