I use iTunes file sharing in my application and you need to put the sqlite Core Data database in a different place so that users do not play with it. I read a previous SO post on the best way to hide the sqlite file that uses Core Data.
There seems to be conflicting opinions as to whether to host the database in the library / Preferences or in a directory named .data , but I think I agree that the best approach is to use the .data directory.
There is currently a -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 Cocoa / Foundation frames to access the directory.
Can someone help me implement this method?
Thanks!
== Rowan ==
objective-c iphone cocoa core-data
Rowan mcqueen
source share