Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My sandboxed app was running fine in 10.8 but in 10.9 it seems that user defaults .plist is not saved at all

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?

like image 553
xarp Avatar asked Oct 10 '13 09:10

xarp


2 Answers

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.

like image 107
xarp Avatar answered Oct 21 '22 05:10

xarp


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.

like image 42
Bruce Hall Avatar answered Oct 21 '22 06:10

Bruce Hall