0

Friends i need to store more than 100 mb data which come in zip format and i get data after unzip this zip file and unzip data is more than 70 mb in size , so my question is that which storage location is good to keep this data, currently i am using cache but it gives memory warning on device when i writes data in cache and then after sometimes app gets crashed.

This zip file contain html pages and images.

i checked this link also but did't get answer to store thes html and images which comes in zip format from server.

Any small help will be highly appreciated.

Thanks in advance

Community
  • 1
  • 1
Stan Roger
  • 67
  • 12

2 Answers2

2

Don't try to read this entire ZIP file into memory at once! It's not the permanent storage (Flash) on the device which goves you the memory warning, but you eat up the RAM. Yes, the Documents or Library directory is fine for storing your app data, just be careful with the memory management.

  • thank u H2Co3 can u tell me how to save this zip file in document directory so that it could' t be sync with icloud. – Stan Roger Jun 30 '12 at 07:46
  • So that it could NOT synced? That's the case for which I suggest the Library directory instead. –  Jun 30 '12 at 07:48
  • H2CO3 my one of my html path is -->iPhone Simulator/5.0/Applications/253AC820-4AFD-4237-91B3-44219DE02A36/Library/Caches/phone/1/1/article1.html, is this the right location to store data? – Stan Roger Jun 30 '12 at 08:02
2

Like H2CO3 stated, the memory warning is indeed caused by reading it all into RAM in one chunk. Apart from that, be sure to follow Apple's guidelines regarding data storage. If the data being saved is temporary, be sure not to store it in your documents directory, otherwise your application might get rejected (Speaking from experience).

Stavash
  • 14,244
  • 5
  • 52
  • 80
  • starvash my one of my html path is -->iPhone Simulator/5.0/Applications/253AC820-4AFD-4237-91B3-44219DE02A36/Library/Caches/phone/1/1/article1.html, is this the right location to store data? – Stan Roger Jun 30 '12 at 08:03
  • 1
    Cache directory on the mac is mapped to a different relative path than it would have on the device. If you obtained a reference to the cache directory in a generic manner, I guess you're in the right direction. – Stavash Jun 30 '12 at 08:11
  • This thread could also help: http://stackoverflow.com/questions/8209406/ios-5-does-not-allow-to-store-downloaded-data-in-documents-directory – Stavash Jun 30 '12 at 08:12