save data of the app, and not loose them if i update the app

Posts: 164
Joined: 2010.10
Post: #1
if i have a local data of an app, suppose a local highscore where i store all my score of the game.
if i release an update of the app, i loose all data.
i save data with this method:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *filename = [documentsDirectory stringByAppendingPathComponent:@"defaultStage.dat"];
    char cstr[512]={0};
    [filename getCString:cstr maxLength:512 encoding:NSASCIIStringEncoding];
    FILE *pFile=fopen(cstr, "wb");
//and save with fprintf
there is a way that save the data "permanently" not to loose when i reinstall, or update the app?
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
the documents directory shouldn't be being deleted on app update...
Quote this message in a reply
Posts: 164
Joined: 2010.10
Post: #3
thanks for response, i'll double check next time i'll update the app
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  can photoshop save a png with only alpha channel? sefiroths 8 16,756 Jan 20, 2011 01:49 AM
Last Post: sefiroths
  Crash during file save Coin 4 6,363 Mar 29, 2005 05:39 PM
Last Post: maaaaark