Yesterday, while doing a screen recording, I noticed that my cocoa apps could no longer write to user defaults to save preferences. I tested the same apps on another version of OS X 10.9 and they worked fine. I restarted my Mac and they work again.
Just before that, I deleted user defaults in username/Library/Containers/<app>. I think Mac needs to restart after deleting the user defaults.