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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:02:19+00:00 2026-05-26T03:02:19+00:00

How do I copy an existing plist I have in the app build to

  • 0

How do I copy an existing plist I have in the app build to the Document directory?

My plist is basically an array of dictionary, I have successfully copy the plist to the directory using the following:

 BOOL success;
            NSError *error;

            NSFileManager *fileManager = [NSFileManager defaultManager];
            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
            NSString *documentsDirectory = [paths objectAtIndex:0];
            NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"States.plist"];

            success = [fileManager fileExistsAtPath:filePath];
            if (success) return;

            NSString *path = [[NSBundle mainBundle] pathForResource:@"States" ofType:@"plist"];    
            success = [fileManager copyItemAtPath:path toPath:filePath error:&error];

            if (!success) {
                NSAssert1(0, @"Failed to copy Plist. Error %@", [error localizedDescription]);
            } 

However, when I try to access the NSDictionary it gives me:

CoreAnimation: ignoring exception: -[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object

Why is this? I have to relaunch the app again and now I can change the dictionary stored in my array

  • 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-26T03:02:20+00:00Added an answer on May 26, 2026 at 3:02 am

    Just create a new pList in the documents directory, and set to the contents of the existing plist you have.

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

Sidebar

Related Questions

I am trying to copy an existing IIS 7.5 app pool using the Powershell
I am trying to copy an existing spreadsheet document by following the example on
I have a copy of an existing database with existing records. when i was
I want to copy few files into an existing zip file using ANT script.
I have the full copy of all the form authentication DB tables existing on
Using SQLite I need to copy nearly all of an existing row from a
Basically I am trying to make a localized copy of an existing English msi
I have to make the copy of my existing site for testing purposes at
My plist array of dictionaries is copied from the bundle to the documents directory
I use the following code to copy a Resources plist file into the documents

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.