A good place to store private data is in ~/Library/Application Support/
, which is the folder used on the Mac for this purpose.
You can create a path to this folder using:
NSString *appSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject];
You will need to create a folder yourself on first use, which you can do with
if (![[NSFileManager defaultManager] fileExistsAtPath:appSupportDir]) { [[NSFileManager defaultManager] createDirectoryAtPath:appSupportDir withIntermediateDirectories:YES attributes:nil error:NULL]; }
I wrote a simple library that makes this and all other useful iOS folders available as methods for NSFileManager: https://github.com/nicklockwood/StandardPaths
source share