Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9071091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:49:54+00:00 2026-06-16T17:49:54+00:00

My iPhone app will download several content to Documents folder while running the application.

  • 0

My iPhone app will download several content to Documents folder while running the application. I want to delete the downloaded files when app is going to terminate. My app runs on target 4.3 or more and ARC enabled. What is the best place to delete content from documents folder ?

- (void)applicationWillTerminate:(UIApplication *)application

is not being called when the app is terminated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:49:54+00:00Added an answer on June 16, 2026 at 5:49 pm

    Look for – applicationDidEnterBackground: instead of applicationWillTerminate.

    In iOS 4.0 and later, this method is called instead of the applicationWillTerminate: method when the user quits an application that supports background execution.

    applicationWillTerminate represents what “quitting” an app used to mean in pre-iOS4 world.

    In modern (i.e., iOS4+) apps, when the user quits the app, the app goes to background and is suspended (so the user can reenter it quickly). So, the app is not actually terminated, still iOS can terminate it anytime if it needs to recover memory. This happens quite often, meaning that if you suspend your app and go back to it the day after, you will find that the app was terminated. The bad thing is that a suspended app will not receive a applicationWillTerminate message when it is terminated, so applicationDidEnterBackground: is the last “guaranteed” chance you have to clean up after yourself when the user quits the app.

    Anyway, you can still get applicationWillTerminate to be called when the user quits your app (and your app terminated accordingly) if you set UIApplicationExitsOnSuspend in your app plist file.

    For the sake of completeness, I will also add that applicationWillTerminate:

    may be called in situations where the application is running in the background (not suspended) and the system needs to terminate it for some reason.

    but this is a specific use case for an app which is actually running in the background (which is the case for a counted number of app types out there).

    Summing it all up, the correct place to clean up the docs is:

    1. applicationDidEnterBackground if you are running iOS4+ and do not set UIApplicationExitsOnSuspend in your app plist file;

    2. applicationWillTerminate if you are running on iOS3 and set UIApplicationExitsOnSuspend in your app plist file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My iPhone app will download a large amount of data from a remote server.
I'm writing an iPhone app that needs to download files that are sometimes over
My iPhone/iPad app will connect to a remote database and will download a zip
If i will download file in iPhone from my custom Application, where it will
I want to create an Ipad/iPhone app that will act as a catalog to
I have an iPhone app that will incorporate liking / +1 with a global
I'm creating an iPhone app that will have a preloaded set of locations with
I am building an iPhone app that will need to display info primarily in
I have an iPhone app where I will be using it as a template
I'm thinking about developing an iPhone/Android app which will include a server side. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.