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 1060471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:19:55+00:00 2026-05-16T18:19:55+00:00

I have stored the data into the plist(documents directory) and retrieved the data from

  • 0

I have stored the data into the plist(documents directory) and retrieved the data from the plist and displayed in the table view. Now i want to remove the plist, when i closed my application. How can i do that?. I have removed plist in my controller. But how can i remove the plist after i closed my application.

For Eg :

FirstViewController.m:

      -(NSString *) saveFilePath::(NSString *)tagString
      {
            NSArray *arr = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

             NSString *strPath = [[arr objectAtIndex:0] stringByAppendingPathComponent:tagString];

            return strPath;
      }

If i want to remove the plist in my controller, i have used this code,

        [[NSFileManager defaultManager]  removeItemAtPath:[self saveFilePath:tagString] error:NULL]; (Where do i put this code into my delegate method?)

But i want to remove the plist, when my application is closed. Because i have used to plist in my controller temporarily only. So i want to remove it? Is any possible to remove plist when i closed my apps?

Please guide me!

Thanks.

  • 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-05-16T18:19:55+00:00Added an answer on May 16, 2026 at 6:19 pm

    Put your code in the applicationWillTerminate method inside Appdelegate class.

    - (void)applicationWillTerminate:(UIApplication *)application { 
              [[NSFileManager defaultManager]  removeItemAtPath:[self saveFilePath:tagString] error:NULL];>
    } 
    

    Also, applicationWillTerminate will not get called on multi-task supporting devices. So you have to add the UIApplicationExitsOnSuspend key on your info.plist. More information on this

    http://iosdevelopertips.com/multitasking/how-to-prevent-your-application-from-being-placed-into-the-background.html

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

Sidebar

Related Questions

I have a table from a vendor application that stores some xml data into
I have stored a variable in database(sqlite) with datetime data type. Now I want
I have a stored procedure that first inserts some data into a temp table
I have a stored procedure that return a varbinary(max) type data. I want to
I have some stored procedures to execute that use dbms_output.put_line() to put data into
Here is the problem. I have a stored procedure that transforms normalized data into
I currently have this code which stores XML into an XML-type column called data,
I have stored data in hidden <input> tags, but it caused reduction in performance.
I have data stored in three columns of Excel Column A: Serial Number Column
I have data stored as below in an MS Access database: Date User 20090101

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.