This may be related to this question but it did not help me much:
Where is a Mac Application's NSUserDefaults Data Stored?
When I quit my application my settings are written to the library/preferences folder and nowhere else. At least I don't see anything else. My application is also not sandboxed. Each time I run my app and change the setting a new settings file is written so I guess this is the real thing and not an old copy.
But if I edit the saved setting or even delete the file my application will start again with the settings it saved before. I even emptied the trash.
Where do these settings come from? I want to reset my application to the default settings I set in code but I am totally unable to do so. It always finds some setting to load.
Edit
I used code from this question: Easy way to see saved NSUserDefaults?
NSArray *path = NSSearchPathForDirectoriesInDomains(
NSLibraryDirectory, NSUserDomainMask, YES);
NSString *folder = [path objectAtIndex:0];
NSLog(@"Your NSUserDefaults are stored in this folder: %@/Preferences", folder);
It output says my settings are in library/Prefrences. So I deleted the file again. When I restart the application it still insists my settings are there.