Reputation: 158
Sandboxed app was running fine in 10.8 but in 10.9 it seems that user defaults. plist is not saved at all. The location of plist is:
~/Library/Containers/com.example.myapp/Data/Library/Preferences/com.example.myapp.plist
and if I delete it, it will not be created again. In 10.8 this was working.
Has anyone seen this before or can anyone suggest a solution?
Upvotes: 6
Views: 2424
Reputation: 314
My work-around for this problem is to kill the 'cfprefsd' daemon processes after making a change to the .plist file:
ps auwx | grep cfprefsd | grep -v grep | awk '{print $2}' | xargs sudo kill -2
The daemons will be restarted after the next access of the .plist file and will then have the new value for the key that was changed.
It is unfortunate that this work-around is necessary but at least it works reliably.
Upvotes: 7
Reputation: 158
Problem solved with a reboot, well short of. Preferences are saved correctly and it works fine until I delete again the app container folder. Then a reboot is required again to fix this.
Upvotes: 9
Reputation: 122391
I had this very issue last night (I am still developing my app). I fixed it by deleting the app container folder (moving the whole ~/Library/Containers/com.domain.appname
to trash in Finder) and re-running the app.
I rebooted first as I saw that there was some sort of LSShared
file, related to my app, that wouldn't be emptied from the trash before the reboot.
I can only imagine it's an intermittent bug in Mavericks (GM seed).
EDIT The comment about a bug may not be true; it looks like .plist
files are "on their way out" according to this Apple Developer Forum thread. However at the end of the day my app (and the OPs) stopped working, so it isn't working reliably.
Upvotes: 1