I am working on a game that makes use of a save/load feature. I am using a Plist for the data.
I have the methods coded correctly... I think?
The issue, however, is that when the home button is pressed, and the App re-launched, the saved data automatically appears.
What I'd prefer is for the data to be manually loaded via a "LOAD" button on the screen.
I know the load button works correctly, but I still need the data to be cleared before the program completely closes (or re开发者_如何学Goloads?). Please help! Thanks!
If you have the app already coded to load the data for you via a "Load" button, then you should just kill the app when the user hits the home button instead of letting the OS suspend your app into the background like it's currently doing.
To do this, you should place the key UIApplicationExitsOnSuspend
in your info.plist file.
More information here: http://developer.apple.com/iphone/library/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW23
精彩评论