iDevGames Forums

Full Version: save data of the app, and not loose them if i update the app
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:
Code:
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];
    
    defaultStage=1;
    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?
thanks
the documents directory shouldn't be being deleted on app update...
thanks for response, i'll double check next time i'll update the app
Reference URL's