Take the 2-minute tour ×

I'm using NSUserDefaults to save some data in my application. Where can I find the file where my data is stored during development? It's a normal cocoa app (so no ios/iphone!)

Once it's deployed, it should be available in Library/Preferences/appname.plist, right? But where can I find it while I'm still working on the application?

share|improve this question
possible duplicate of Easy way to see saved NSUserDefaults? –  doNotCheckMyBlog Jul 19 '12 at 0:47
Not really a duplicate -- that one's about iOS, this one's about OS X. –  Kurt Revis Jul 19 '12 at 0:56
+1, Oops my bad! –  doNotCheckMyBlog Jul 19 '12 at 1:00

1 Answer 1

up vote 5 down vote accepted

There is no difference between "development" and "deployment". NSUserDefaults doesn't know whether you did a debug or release build. The location should be ~/Library/Preferences/yourAppIdentifier.plist no matter what.

If you are seeing a difference between development and deployment builds, maybe check the bundle identifier (CFBundleIdentifier) in your app's Info.plist.

Also: if your app is sandboxed, your prefs will end up in the sandbox: ~/Library/Containers/yourAppIdentifier/Data/Library/Preferences/yourAppIdentifier.plist. The documentation claims that the system automatically moves your old preferences file into the sandbox, if necessary, on the first launch of the sandboxed version of the app.

share|improve this answer
My CFBundleIdentifier is be.company.${PRODUCT_NAME:rfc1034identifier}, but after running my application in xcode, I can't find anything starting with be. in either HD/Llibrary or ~/Library. I also don't have a ~/Library/Containers folder. –  Dauntless Jul 19 '12 at 11:11
To be absolutely sure: check the Info.plist file in the built app. Maybe something is messing it up. –  Kurt Revis Jul 19 '12 at 19:31
It's correct in the Info.plist. Still nothing though. I'll just keep searching. At least I know where to look now. –  Dauntless Jul 19 '12 at 20:00

Your Answer


