Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where to store data in Cocoa app?

I hope to migrate one of my windows app to mac.

As we know, on vista/win7, there are public data directories that one app can add, save and delete data files without RAC permission.

Are there same directories on Mac/Cocoa?

or

I can store the data to any directory without any problem and any permission?

Welcome any comment

like image 830
monsabre Avatar asked Aug 26 '11 02:08

monsabre


2 Answers

These are the 3 you can write to:

~/Library/Application Support/app-identifier

~/Library/app-identifier

~/Library/Caches/app-identifier

(replace app-identifer with your app identifier)

More info here under "File-System Usage Requirements for the Mac App Store"

like image 137
Matt S. Avatar answered Sep 27 '22 20:09

Matt S.


You can, by default, unless you enable sand-boxing, write to any directory the user has access to. Generally though, Cocoa apps store data in the user's home directory in ~/Library/Application Support/<your-app-name>

like image 23
Maz Avatar answered Sep 27 '22 21:09

Maz