0

I am developping an ios game and i would like to know if the the saves in plist are secured ? I have some questions that i don't really know the answers for exemple if the user exit the apps during the time a save occurs what happend ?

I find plist very useful and easy to use i store for example a lot of coordinates and informations about the user interface but on these files i only read informations. And in other plist i store some datas likes high scores, statics, points that are needed to be refresh and saved with new values every time after a game over or when user buy new store accessories.

How to handle for example a corrupt file because of a bad saving. I can make a copy every on the new plist every odd game played and have a files that can be reload and not losed but it seems to be a bad solution and stupid but i don't want to create an app where users can lost all the data because of a saved failure and start the game from the begining.

I read some links like this one(Saving game score locally on iOS device...is security needed?) but i prefer to keep plist files than using NSUserDefaults because i have a lot of datas to save.

I think about a solution where the user can store a copy on the cloud of the plist like that he delete the app it can have access to his preferences or if a failure saved to retrieve automatically a valid file but it seems weird and i never work on that kind of stuff.

I read more posts and i really need advices here and hope i don't duplicate a question.

Community
  • 1
  • 1
Aaleks
  • 4,283
  • 5
  • 31
  • 39

1 Answers1

0

A quick, easy and reliable solution would be to use the PARSE library. I would use the Parse Core framework. It would save you a lot of headaches. https://parse.com/products/core#howitworks

Code Example:

// Create a new Parse object
PFObject *post = [PFObject objectWithClassName:@"Post"];
[post setObject:@"Hello World" forKey:@"title"];

// Save it to Parse
[post saveInBackground];

They even have an option to SAVE EVENTUALLY for cases where you are not sure of Wifi/3g connectivity

// Create the object.
PFObject *gameScore = [PFObject objectWithClassName:@"GameScore"];
gameScore[@"score"] = @1337;
gameScore[@"playerName"] = @"Sean Plott";
gameScore[@"cheatMode"] = @NO;
[gameScore saveEventually];
archipestre
  • 182
  • 9
  • thanks for your answer i don't know about the parse library before but this solution may be good i will search more because i don't really know how well it is integrated with apple how about for exemple during an app update when you need to transfer the userPreferences to the new app – Aaleks Sep 29 '14 at 23:47
  • The parse library is very well integrated with iOS. The library is backed by Facebook, since they bought it a year ago (or more). Please, Let us know if you manage to do it. – archipestre Sep 30 '14 at 22:44
  • i read about cloud kit maybe it a best solution ? It seems very easy to use – Aaleks Oct 01 '14 at 10:58