Moving one of my projects to support sandboxing as per Apple's requirements. I use UserDefaults like so:
[[NSUserDefaults standardUserDefaults] setObject:@(myNumber) forKey:myNumberKey];
[[NSUserDefaults standardUserDefaults] synchronize];
Everything works as expected until I enable sandboxing. If I have sandboxing enabled the app creates a lock file in it's sandbox directory ( .plist.lockfile) and doesn't create an actual .plist file.
What am I doing wrong and how do I store my settings in UserDefaults under sandbox environment?
Update: Installed fresh 10.7.3 with the latest Xcode on a separate Mac - the same project compiles and works fine with sandboxing enabled.
Also I've tried to run this project on my Mac where the sandbox doesn't work under different user account (freshly created) with exactly the same results - no go. At this point I think the problem is with system configuration on this particular mac. Question is though - is it safe to assume that I'm the only one with this weird problem? Probably not...