Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save file in OS X in a private folder like iOS documents folder

Does OS X have a place within the application to save files like how you save files to the documents folders in iOS. I have .plist files to save for my app but I only want to be able to access them form within the app. Don't want do have a folder in the users documents folder or anything.

Primarily an iOS guy so apologies if this is obvious.

like image 992
HenryGale Avatar asked Nov 19 '25 04:11

HenryGale


1 Answers

I'm not exactly sure what you want here.

To get a directory to store files in an out of the way location, you can use the Application Support directory (~/Library/Application Support/[APP_NAME]/).

To get the name of this directory, you pass NSApplicationSupportDirectory to -URLsForDirectory:inDomains: (see: Managing Files and Directories).


To prevent the user from reading a file, you can encrypt it (see: Encrypting and Hashing Data).

like image 192
Jeffery Thomas Avatar answered Nov 21 '25 17:11

Jeffery Thomas