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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:38:52+00:00 2026-05-23T23:38:52+00:00

I have a .plist filled with data that ships with my app. It’s basically

  • 0

I have a .plist filled with data that ships with my app.

It’s basically an array of dictionaries with other arrays/dictionaries in it.

The values I take from this array and use in my app may be a name, so “Computer”.

I’m adding a feature to let the user create their own item, instead of choosing from what is loading from the array. But should I then save this item into the same .plist, or create a separate .plist for each user?

Then, how do I pull info from both the standard .plist and the user created .plist and load them into one tableView?

  • 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-23T23:38:53+00:00Added an answer on May 23, 2026 at 11:38 pm

    If you’re writing for iOS, you can’t really save to same plist file because you can’t write to the application bundle.
    One thing you could do is save a copy of that plist to the application’s Documents folder, and then modify that same plist, that way all your data is unified in a single file.
    Or you can always load the original plist from the application bundle, make a mutable copy of the NSArray, load an additional plist from the Documents folder with the user’s objects, and append them to the NSMutableArray by calling addObjectsFromArray.
    Or you can even keep them in separate NSArray but display them in the table view as one by returning [originalDataArray count] + [userDataArray count] from the tableView:numberOfRowsInSection: method of your table view data source, and of course use the appropriate data in the tableView:cellForRowAtIndexPath: method.

    EDIT:

    About saving the user data, you don’t necessarily have to worry about writing a plist.
    The NSArray conforms to the NSCoding protocol, and so do NSDictionary, which means you can easily save it and load it using something like the NSKeyedArchiver class.

    Here’s an example of something I had in an old project of mine, where I had a NSMutableArray that held some user generated data, and I saved it and loaded it with NSKeyedArchiver (simplified to only show the relevant code, and was done over a year ago when I was just starting with ios, so might not be the best possible way of doing it):

    - (BOOL) saveData
    {
        BOOL success = NO;
    
        NSArray *pathList = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, NO);
    
        NSString *path = [[[pathList objectAtIndex:0] stringByAppendingPathComponent:@"data.txt"] stringByExpandingTildeInPath];
    
        success = [NSKeyedArchiver archiveRootObject:myArray toFile:path];
        //note: myArray is an NSMutableArray, could be an NSArray
    
        return success;
    }
    
    
    - (BOOL) loadData
    {
        BOOL success = NO;
    
        NSArray *pathList = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, NO);
    
        NSString *path = [[[pathList objectAtIndex:0] stringByAppendingPathComponent:@"data.txt"] stringByExpandingTildeInPath];
    
        if( (myArray = [NSKeyedUnarchiver unarchiveObjectWithFile:path]) )
        {
            [myArray retain];
            success = YES;
        }
        else
        {
            myArray = [[NSMutableArray alloc] init];
            success = NO;
        }
    
        return success;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a property list ( Data.plist ) that contains an array of two
i have a plist that's at its root an array with dictonaries inside it.
I have successfully created an app that reads from a bundled .plist file and
When I use NSKeyedArchiver is the data that is written a *.plist, I have
I have a plist file in my main app bundle that I want to
I have a .plist that I have had translated in my app. Originally, I
I have a plist file which contains an array of dictionaries. Here is one
I have a .plist file that looks like this: <plist version=1.0> <array> <dict> <key>name</key>
I have a data-structure (in plist) that looks something like this: What i have
I have a sectioned tableview with a plist wich is an array filled with

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.