Reputation: 471
Until now my database was saved in the documents directory of application. Now Apple refuse to do it anymore and I need to change the directory.
Does anyone know how to save a database in cached directory, or even direct me to a tutorial/example.
Upvotes: 1
Views: 506
Reputation: 122391
The caches directory will be the last entry returned from NSSearchPathForDirectoriesInDomains
:
NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
NSString *dbPath = [cachesPath stringByAppendingPathComponent:@"mydatabase.db"];
Upvotes: 2