Hello,
I am using iTunes file sharing in my app, and need to put Core Data's sqlite database elsewhere so that users don't fiddle with it. I have read a previous SO post regarding the best way to hide the sqlite file that Core Data uses.
There seems to be conflicting opinions regarding whether to put the database in Library/Preferences or in a directory called .data
, but I think I agree the best approach is to use the .data
directory.
There is currently an -applicationDocumentsDirectory
method that was provided by the Core Data template code:
- (NSString *)applicationDocumentsDirectory {
return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
}
I would like to implement a function called applicationHiddenDocumentsDirectory
that will give me access to the ".data" subdirectory, but I don't know enough about Objective-C or the Cocoa/Foundation frameworks to access the directory.
Could someone help me implement this method please?
Thanks!
==Rowan==