I want to save files of user settings of my iPhone app in ~/Library/ directory.
I don't want to use ~/Documents/ directory because I don't want users to see or modify the files in iTunes using the file sharing feature.
But there are 4 choices to save files in ~/Library/:
1. ~/Library/some-data.plist
This uses Library/ directory without creating a subdirectory in it.
(The API constant name is NSLibraryDirectory)
2. ~/Library/MyAppName/some-data.plist
This uses Library/ directory and a subdirectory which name is my app's name.
3. ~/Library/Application Support/some-data.plist
This uses Application Support/ directory without creating a subdirectory in it.
(The API constant name is NSApplicationSupportDirectory)
4. ~/Library/Application Support/MyAppName/some-data.plist
This uses Application Support/ directory and a subdirectory which name is my app's name.
Questions
What are the merits and demerits of the each path above?
And where do you save your app's data in Library/?
Should I use ~/Library/ or ~/Library/Application Support/?
Should I create a subdirectory or shouldn't I create it?
If I should create a subdirectory, is it a good practice to use my app's name for the subdirectory?
Or is there better names for the subdirectory?
From: File System Programming Guide
Put app-created support files in the Library/Application support/ directory. In general, this directory includes files that the app uses to run but that should remain hidden from the user. This directory can also include data files, configuration files, templates and modified versions of resources loaded from the app bundle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With