I find it difficult to understand why NSUserDefaults leaves junk file files in the library / Preferences for my application.
I see the following files ...
com.mycompany.myapp.plist com.mycompany.myapp.plist.3gaPYul com.mycompany.myapp.plist.c97yxEH
... etc. The plist.* Files are 0 bytes. It seems that every time the application starts, it leaves a new one. I made sure that I did not call at all -[NSUserDefaults synchronize] , but if I call him, it speeds up the appearance of unwanted files for this run. Going into the debugger, as soon as I go to the call for synchronization, a new file appeared. If I take out a synchronization call, a new spam file sometimes appears when the application starts, and sometimes when the application closes.
I also check to see if itβs possible that I am setting the default user in the stream (unlikely, but possibly possible), thought the docs say it is thread safe.
Any help is appreciated. Thanks!
EDIT:
Just found this: CFPreferences creates multiple files
While I agree with the idea of ββthe defendants, he does not explain βwhy?β. part.
bsneed
source share