Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 41

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
12/03/14 07:28 PM (9 years ago)

Question about NSUserDefaults

I'm working on a new game, and using NSUserDefaults to store some of the game info. My question is, if I release an update, does the NSUserDefaults data get wiped out? I know that coredata is the proper way to save app specific data, but still learning how to use it, however I'm pretty comfortable with NSUserDefaults. Just don't want the data to get overwritten upon an update. From past experience, I think the data remains in tact, but just looking for verification. Thanks!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/03/14 07:58 PM (9 years ago)
They are usually not reset unless the user deletes the app. For basic data, NSUserDefaults is the best way to save data such as preferences, dates, strings etc. If you are looking to save images and files, the file system is a better bet. http://stackoverflow.com/questions/1638766/do-nsuserdefaults-persist-through-an-update-to-an-app-in-the-appstore
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
12/04/14 05:24 AM (9 years ago)
Cool, I thought that's how I remembered it working. Thanks Niraj!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.