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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:38:26+00:00 2026-05-28T04:38:26+00:00

I have been reading so many topics here about this, but I could not

  • 0

I have been reading so many topics here about this, but I could not have found it yet.

I want to have a UITableView where I can put some dictionaries and inside them, have words with some fields (about 4). So far it is ok, but my question is what is the best way to don’t erase the data after upgrading the app to a new version. I mean, when an user upgrade the app, all those words/dictionaries won’t be deleted because of the update.

I don’t know if I should use a NSMutableArray of class of words (for example), or use Core Data, or SQLite.

Any help would be very appreciated.
Thanks in advance.

  • 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-28T04:38:27+00:00Added an answer on May 28, 2026 at 4:38 am

    If you have dictionaries that are in fact NSDictionaries, serializing them using NSCoding protocol to a file inside of the documents is easy, fast and reliable. The contents of the Documents directory remain unchanged if you do an upgrade of the app.

    This is the code I use in one of my apps (it saves a list of quotes that has been favorited by the user)

    - (BOOL) saveQuotesToDisk
    {
        //get path to events list    
        NSArray * dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString * fullpath = [NSString stringWithFormat:@"%@/%@", [dirPaths objectAtIndex:0], @"FavQuoteList.plist"];
    
        //create data to be saved
        NSMutableDictionary * rootObject = [NSMutableDictionary dictionary];
        [rootObject setValue: _SavedQuotes forKey:@"_SavedQuotes"];
    
        //write data
        bool success = [NSKeyedArchiver archiveRootObject: rootObject
                                                   toFile: fullpath];
    
        if (success) NSLog(@"Quotes list saved.");
        else NSLog(@"ERROR on saving quotes list!");
    
        return success;
    }
    
    - (BOOL) readFavoriteQuotesFromDisk
    {
        //get path to quote list    
        NSArray * dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString * fullpath = [NSString stringWithFormat:@"%@/%@", [dirPaths objectAtIndex:0], @"FavQuoteList.plist"];
    
        //read data
        NSDictionary * rootObject = [NSKeyedUnarchiver unarchiveObjectWithFile: fullpath ];
        _SavedQuotes = [[rootObject valueForKey:@"_SavedQuotes"] retain];
    
        //check data
        if (_SavedQuotes == nil) return NO;
        else return YES;
    }
    

    You can add more objects to the rootObject as long as they conform to NSCoding Protocol.

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

Sidebar

Related Questions

I have been reading about model inheritances in django and have found that many
I have been reading around for other answers but i am still not understanding
I have been reading this article: Many ways to communicate with your database using
I have been reading the many posts on this topic and have been trying
I have been reading many posts that describe my problem but I cannot find
Have been reading about async and tasks and been attempting to convert the CopyFileEx
I have been reading through the C++ FAQ and was curious about the friend
I have been reading about the differences between Table Variables and Temp Tables and
i have been reading this interesting article which is increasing my every growing confusion
I have been reading up on multiple PHP frameworks, especially the Zend Framework but

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.