I’m wondering how many images I can store in the iPhone documents directory so that I don’t get any memory issues. I’m torn between caching images or loading them from a webserver every time the user wants to access them. There most likely won’t be more than 10-20 images cached at any given time…
Any thoughts?
There’s a 2GB cap on the largest size of a single file in the
/Documentsfolder. Other than that, you can store as many images as you want. iOS itself didn’t put a limitation on how much space you can use on a device. So your space limit is the size of Flash on the device (i.e. 16GB, 32GB etc).You might consider use the
/Library/Cachesinstead because iCloud will attempt to sync the Documents folder (if entitlements are configured). I heard App being rejected by review for excessive use of the Documents folder. To get the path, callNSSearchPathForDirectoriesInDomainswithNSCachesDirectoryandNSUserDomainMask.Though a user can determine the size of space you are occupying in System Settings.