joaopenteado
joaopenteado

Reputation: 118

Where can I store my application's files?

Well, I'm new to the Mac OS X platform and seriously I don't know anything about it. I mean on Windows I just store it at the Program's Files directory, What about the Mac, is there any recommended place to put the files?

Upvotes: 1

Views: 399

Answers (3)

bbum
bbum

Reputation: 162722

Resources related to your application that will not be changed after the app is installed going into the app wrapper (see documentation).

Cached data that can be deleted at any time goes in ~/Library/Caches.

Supporting data that should generally be persisted, but isn't document data, goes in ~/Library/Application Support.

Documents and user data that is primary to the purpose of your app goes in ~/Documents, generally.

Preferences go in ~/Library/Preferences, but are generally read/written entirely via the NSUserDefaults API.

Upvotes: 5

WrightsCS
WrightsCS

Reputation: 50727

You can store your application-created / application-deependant files in ~/Library/Application Support/YourApp/Files. Otherwise, user created Documents would most likely be best stored in the Documents directory.

Upvotes: -1

Antwan van Houdt
Antwan van Houdt

Reputation: 6991

~/Library/Application Support/YourAppName/yourFilesHere

This way the files will be personal to the user using your app. If you want tho files to be global they should be in your app bundle/Resources/

To get the home directory ( the tilde ~ ) you can use NSHomeDirectory or you could use [@"~" stringByExpandingTildeIntoPath];

Upvotes: 2

Related Questions