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.
            Asked
            
        
        
            Active
            
        
            Viewed 289 times
        
    -1
            
            
        - 
                    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 Answers
-1
            
            
        You use the code in applicationWillTerminate callback:
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier]; [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];
 
    
    
        user2837760
        
- 1
- 3
