ios - NSUserDefaults not cleared after app uninstall on simulator -
This could be the real NOOB sound! I want to know that the user is entering my application for the second time, so I am using the NSUserDefaults
to keep the number of runs. I have implemented the following code in my rootViewController
method in the viewDidLoad
method:
NSUserDefaults * userDefaults = [NSUserDefaults StandardUserDefaults]; NSLog (@ "hello% ld", (long) [userDefaults fullcolor: @ "runcount"]); If ([userDefaults integerForKey: @ "runCount"]! = 1) {// 2nd run [userDefaults setInteger: 1 forKey: @ "runCount"]; NSLog (@ "not 2 runs"); } Other {// seconds run or more NSLog (@ "2 runs"); } [Synchronize UserDefaults];
Everything works fine, but the problem is that when I uninstall (delete and re-install) the application and data should be cleaned, but it will Not after the installation is the last data of the app still showing I'm running my app using the encoded 6-beta on the iOS simulator and I'm targeting the app on iOS 8
I Confirms that it is caused by a bug in iOS8 beta simulator.
The expected behavior is that when the app is destroyed, NSUserDefaults for that app are also deleted.
- However, when you delete the app from the simulator, the NSUserDefaults not are deleted.
- When you delete from a physical device running iOS8, they are deleted properly. / P>
Comments
Post a Comment