I am showing a license form at app startup, but it should be shown only at the first time the app launched. Not always. So, i tried to store a flag in plist or user defaults, but upon the app removing(move to trash), plist or userdefaults is not getting removed from system, thus i’m not able to achieve my task.
This is what i have been trying below,
I am storing a flag in plist file and save the file(in Documents directory) during App launch, so next time , i can read from there and find out whether the app is running first time or not. I am failing here, because even the app is removed(move to trash) from system, i am not able to remove this plist file.
I tried to set a flag in NSUserDefaults too, but after deleting the app and build again and launch the app, it still persists the previous value i stored. I am wondering, NSUserDefaults doesn’t get deleted when app is deleted from system?
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setObject:@"1" forKey:@"APPLAUNCHED"]; // store user default
[ud synchronize];
Could someone please advise?
Thank you.
Neither user defaults nor the application sandbox get automatically removed when the application is deleted. I think there’s no way to do that.