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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:27:46+00:00 2026-05-27T03:27:46+00:00

When I update from iOS 4+ to iOS 5, I lose all data in

  • 0

When I update from iOS 4+ to iOS 5, I lose all data in my own app. I also upgraded to OSX Lion and Xcode 4. I back up my iPhone in iTunes and was able to get the data using iPhone Backup Extractor.

I save my app data to a file in the following way:

- (NSString *)iouArrayPath
{
    // Standard way of getting file path for iOS
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *dir = [paths objectAtIndex:0];
    NSLog(@"Directory: %@", dir);

    return pathInDocumentDirectory(@"IouTableArray.data");
}

- (void)archieveIou
{
    NSLog(@"archieveIou");

    // Get the path to the document directory
    NSString *iouPath = [self iouArrayPath];

    // grab the objects to archieve
    NSMutableArray *iouTableArray = [iouViewController iouTableArray];

    // ARCHIVE DATA
    NSMutableData *data = [NSMutableData data];
    NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
    [archiver encodeObject:iouTableArray forKey:@"IouTableArray"];
    [archiver finishEncoding];
    [data writeToFile:iouPath atomically:YES];

    if([data writeToFile:iouPath atomically:YES]) {
        NSLog(@"writeToFile success!");
    }
    else {
        NSLog(@"writeToFile failed");
    }
    [archiver release];
}

This is what I’ve tried to understand. I open the project in Xcode 4, I copy the .data file from the backup and paste it to the /iPhone Simulator/5.0/Applications/Some digit/Documents. Theorectically, when the app starts, it will look into that folder and load the .data file if it exists. It does not. However, the app will work fine if I create some test data and save it. It will replace the backup file with the same file name and properly load it when I restart the app.

This makes me wonder if there is some NSCoder/archieving change between XCode3/XCode4 or between iOS4 and iOS5.

Does anyone know what is going on? Once I figure this out, I plan to use the backup data file and copy it to the current app /Document folder. Actually, come to think of it, I am not sure how to do that either. The /Document folder for the app reside within the phone. I’ll have to see if I can use iTunes and inject the app with the data. Anyways, first things first! Understand the system.

Thanks!

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

    It turns out that iOS5 installs an older version of the app. Strange but make sure you get all your provisioning squared out.

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

Sidebar

Related Questions

I am trying to use jQuery's ajax functionality to update data from a web
I've made a universal iPhone/iPad app (transitioned from iPhone only), but in a future
My iPhone app was recently rejected from the App Store because it crashes on
I am developing iPhone application which involves the frameworks available from iOS 3.2 (Core
I'm trying to produce gcd a files from an iOS Xcode 4.2 (4D199) project
When I debug an OSX application from XCode, I can communicate with the application's
I currently have Xcode 4.1 installed. I attempted to update using the App Store
I am in the process from transitioning an iOS app from one developer account
In my future iOS app, the app will constantly be interacting and retrieving data
Update: Solved. See fix at bottom. In my iPad app which supports all orientations,

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.