-1

I have one.dmg file, installed it one time and some data saved in NSUserDefaults. But When I am remove from application as well Trash its not cleared of that NSUserDefaults. I want to remove all of that.

iOSDeV
  • 77
  • 10
  • It won't happen without user's permission, I suppose, since the file is located in the Preferences folder. – El Tomato Feb 20 '18 at 06:16
  • But how can delete all data of Preferences when we removed our application from mac system. In iOS mobile device its automatically deleted. – iOSDeV Feb 20 '18 at 06:20
  • @iOSDeV, Did you find any solution for this? how to clear UserDefaults ? – Krishna Maru Dec 13 '18 at 10:28

1 Answers1

-1

You use the code in applicationWillTerminate callback:

NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier]; [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];

https://stackoverflow.com/a/29653178/2837760