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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:37:33+00:00 2026-06-10T07:37:33+00:00

My plist array of dictionaries is copied from the bundle to the documents directory

  • 0

My plist array of dictionaries is copied from the bundle to the documents directory if it doesn’t already exist (appDidFinishLaunching).

Some of the strings in the dictionaries are user defined and have a default value before value is set by the user. (i.e. Key: “Favorite” value: “No” changes to “Yes” if added to favorites)

If I change some of the strings in some of the dictionaries (like if price of object changes) and/or add some new dictionaries to the array, how to manage those changes without changing the user defined strings?

I’ve thought about two options:

1: Compare strings in excisting dictionaries with the strings in the updated dictionaries and replace the changed ones without touching the user defined strings. Also look for new dictionaries.

2: Make a new plist of dictionaries for the user defined strings, with i.e. “Name” string equal the main object so they can be “connected” when the contents are displayed.. Then the main plist can be replaced and the user defined data remain untouched.

I think nr 2 would be the simplest way. But this is my first application so I don’t know for sure..

So my question is: Is option 2 a good way? If yes, confirmation is accepted as answer. If no, I guess it’s because you see some potential troubles, please explain and maybe suggest alternative ways if not nr 1.

Ps. current code for copy:

- (void)copyPlist {
    NSError *error;
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Objects.plist"];
     NSLog(@"Path %@", path); 

    NSFileManager *fileManager = [NSFileManager defaultManager];

    if (![fileManager fileExistsAtPath: path])
    {
        NSString *bundle = [[NSBundle mainBundle] pathForResource:@"Objects" ofType:@"plist"];

        [fileManager copyItemAtPath:bundle toPath:path error:&error];
    }
}
  • 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-10T07:37:34+00:00Added an answer on June 10, 2026 at 7:37 am

    I think option 2 would be your best option. Only let the user change the display names, not the internal names you use for the properties. Otherwise, what if you added another field, “Foo”, at some point, but the user already had renamed the existing field “Bar” to be “Foo”?

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

Sidebar

Related Questions

Im copying the plist array of dictionaries to documents directory on the device like
I have an array of dictionaries loaded from a plist (below) called arrayHistory. <plist
I'm trying to display data from a plist that is an array of dictionaries:
I've been using the following to create an array from a plist of dictionaries:
My plist is an array with dictionaries . At launch, the .plist is copied
I have a plist (array of dictionaries) which populates a table view and works
I have a plist file which is an array of dictionaries. Where each dictionary
I am using the method below to get an array from my plist and
I have a plist file which contains an array of dictionaries. Here is one
I have a dictionary of dictionaries and I have retrieved from a plist. Suppose

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.