Hello everyone .. Now a days, we are noticing that many people are getting rejection from AppStore due to storage issue; I looked into this issue and here are my findings regarding iOS-5 and iCloud; When we install our application in device, we have three main directories in our application space
  • <Application_Home>/Documents
  • <Application_Home>/Library/Caches
  • <Application_Home>/tmp
Applications normally store their data in the/Document directory and everything work normally. Applications can also store their temporary data in /tmp and /Library/Caches directories, and it get deleted when user uninstalls the app from device; Apple accepted such applications in past that store application-specific data, as well as downloadable content in the /Document directory. Examples are magazine app etc. In iOS 5, the iCloud was introduced; It keeps users' applications and data synced among different devices. In actual, iCloud sync everything that present in /Document directory for an application. As this data may be large (including downloadable content), Apple has now start rejecting such apps that store their data in the /Document directory, saying that as iCloud backups are performed daily over Wi-Fi for each user’s iOS device, it’s important to ensure the best possible user experience by minimizing the amount of data being stored by your app. In addition to purchased music, apps, books, camera roll, and device settings, everything in your app’s home directory, including its Documents folder, is backed up to iCloud. Many developers store all of application's data in /Document directory. So due to iCloud issue, the option of storing our data at this place has been eliminated. The alternate was /tmp and /Library/Caches directories, as we all knew that they are intact by iCloud and OS; But in iOS 5, there’s an important change with these two directories --the only two directories that aren’t backed up — are now "cleaned" out without any notification or alert to user, when the device is low on space; If someone have never observed files being removed from these directories in the past, that is not a guarantee that it will not change in the future. Especially when the change is in accordance with documentation; So at this point, all possible places are not reliable to store downloadable data;
  1. using /Document directory will surly lead our app to rejection.
  2. Cache and/or tmp directories are afraid of being cleaned out at time if device has low storage space; Worst aspect is user won't be notified for both low storage and for cleaning process.
Apple suggest two possible solutions for this issue:
  1. Mark the files "do not backup" if you dont' want your file to be backed up by iCloud. Issue: This may be a possible solution but this flag is available from 5.0.1, Not even in 5.0.
  2. Your application should store all downloadable data in the cache or tmp directory, and keep watching them keenly if some important data is deleted by OS. In such case, user should ask to download them again. Issue: But even with available, fast, unlimited internet connectivity, randomly deleting an app’s data is still a problem; User may feel annoy by downloading the content time and again.
What I did with my application is
  • Start storing all downloadable contents in /Library/Cache
  • For existing users, I moved all their contents from /Document to /Library/Cache;
  • /Document directory has now only a database file (which is treated as application specific data) All downloadable contents has moved to /Library/Cache.
Here are two links that discuss the whole story in a very nice way: First read http://www.marco.org/2011/10/13/ios5-caches-cleaning and then http://iphoneincubator.com/blog/data-management/local-file-storage-in-ios-5 If anyone has more info on this topic, kindly share;