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

  • Home
  • SEARCH
  • 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 9056265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:09:37+00:00 2026-06-16T14:09:37+00:00

I’m getting ready to release a new update for my app which stores data

  • 0

I’m getting ready to release a new update for my app which stores data in the local bundle path and I want to ensure the data stored in this path isn’t deleted when they update. Can this happen and what should I watch out for?

This is the code I’m using to get the path to store data:

// Temporary method variables
NSError *error;

// Create a list of paths
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

// Get the path to the apps documents directory from the array
NSString *documentsDirectory = [paths objectAtIndex:0];

// Create a full path to the file
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"FFUserPrefs.plist"];

// Access the file manager
NSFileManager *fileManager = [NSFileManager defaultManager];

// Check if the file exists and if not, copy from the bundle path to the documents path
if (![fileManager fileExistsAtPath:path])
{
    // Get path to file from bundle directory
    NSString *pathBundle = [[NSBundle mainBundle] pathForResource:@"FFUserPrefs" ofType:@"plist"];

    // Copy pref file to app documents folder
    [fileManager copyItemAtPath:pathBundle toPath:path error:&error];
}

I’m just afraid that the data my users have stored in this directory could be lost and want to make sure it is still there after updating. The only reason I ask is because after running my new build via xCode on my phone that had the release application installed, it wiped out the data and started fresh. What am I missing? Does the app bundle path change between Xcode and release. Any info would be greatly appreciated!

  • 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-16T14:09:39+00:00Added an answer on June 16, 2026 at 2:09 pm

    Files stored in the documents directory will not be removed during an app update. FFUserPrefs.plist is stored in the documents directory, so it will still be there after the update. Files stored in the app bundle ([NSBundle mainBundle]), however, will be replaced by the new bundle.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I want to construct a data frame in an Rcpp function, but when I
I am writing an app for my school newspaper, which is run completely online
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a French site that I want to parse, but am running into
I'm interested in microtypography issues on the web. I want a tool to fix:

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.