Possible Duplicate:
Mac OS X: Where should I store save games for a game delivered as a bundle?
i am migrating my iOS game to mac. The file I used to store high scores is saved under xxx.app/Contents/Resources. However, when I enable the sandbox and entitlement, the directory becomes unwritable. I tried xxx.app and xxx.app/Contents as well without luck.
so which directory should I use or which entitlement should I add?
EDIT
I have tried ~/Library/Application Support/Your Game Name/ and it does not show permission errors but unable to save the game data. there is no Library under user/my_name, but one under unser/shared. Do i need to add any entitlements?
EDIT 2:
Please dont close this question. The answer to earlier question does not work for me. Instead, the flagged answer of this question is correct.
Under app sandboxing your app has a container folder in which it can write pretty much anywhere, however I would recommend just writing to the Data/Documents folder, which can be obtained using the following code:
This will give you the folder at
~/Library/Containers/com.yourdomain.yourapp/Data/Documents. Note that the~/Libraryfolder is hidden under Lion/Mountain Lion so needs to be unhidden using this on the command line:(Only you, the developer, needs to unhide that folder so you can poke around from Finder to see what your app has written; your user’s won’t need to unhide it to use your app).