0

I am using phonegap for IOS app development. Now, phonegap tries to find the db by default in 'NSCachesDirectory', but whenever IOS runs into memory problems, it tries to delete data from 'NSCachesDirectory', so, the data is not secured. If i am not mistaken, this problem was solved in cordova 2.1.0, where the back-up of data is taken and then restored afterwards. So, just wanted to confirm if i am heading in the right direction or data itself can be stored in 'NSDocumentDirectory' so that data is secured and somehow phonegap looks for db in 'NSDocumentDirectory' and not Caches direcory. Thanks.

clint
  • 1,786
  • 4
  • 34
  • 60

1 Answers1

0

Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the /Documents directory(You can store DB in Documents directory)

Data that can be downloaded again or regenerated should be stored in the /Library/Caches directory.

Pranav Jaiswal
  • 3,752
  • 3
  • 32
  • 50
  • Ok if i store db in Documents directory, how will i make phonegap look for db in /Documents directory and not /Caches directory. – clint Dec 13 '12 at 06:52
  • I have no idea abt 'PhoneGap' may be check this link http://stackoverflow.com/questions/10442131/ios-application-base-path – Pranav Jaiswal Dec 13 '12 at 08:43