While working on my Mac app, I often faced the need to delete the NSUserDefaults file manually. The NSUserDefaults of a mac application are stored in a .plist file whose location depends on whether the application is sandboxed or not.
Assassin's Creed Memories. Assassin's Creed Memories is a mobile game that was released on iOS devices on August 20, 2014. Developed along with PlayNext and Gree, the game combines card collection and battling, target chasing, and strategy elements, along with the option of competitive multiplayer. Memories and Murder can be read as a standalone for those new to the series. The author provides the necessary background information on the main characters. Memories and Murder is easy to read thanks to the author’s conversational writing style and smooth flow of the story. The mystery was different because it addresses the issue of elder fraud.
When deleting the .plist file, I faced a problem. Even after deleting the file, the application still seemed to be picking up values from it at runtime. A little bit of exploring led me to the fact that a process named cfprefsd retains a link to the .plist file even after it’s moved to trash and hence the deleted values still get served to the app.
I found that emptying the trash alone isn’t enough. The cfprefsd process must also be killed using the terminal command:
killall kill cfprefsd
Executing the above command delivers the behaviour we expect. Values are read from the new .plist file. Hope this comes handy to Mac OS X developers out there. Good Luck And Good Life!!!