0

I am working on an iPhone app in which one feature allows users to upload a profile image. The profile image is essentially for their own use as this is not a social media app and no other users will be able to see the image. I am wondering if instead of requiring the image to be uploaded to a server, if it can be uploaded and stored on the iPhone's local cache instead. If so, would the image be lost if the user restarts their phone or updates the app? If a method of doing this is possible, please post either a link or code. Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Chase Kretch
  • 19
  • 1
  • 7
  • If you store the image in disk it will be there across phone restarts and app updates. The only moment when it will be erased will be the app being removed from the phone, and the phone being reset to factory defaults. – yonosoytu Jun 22 '13 at 08:04

1 Answers1

0

Storing the file locally will mean it's persisted, but only (guaranteed) if you put it in the correct place. You also want to consider the cost to the user when they backup their device and whether this information should be saved too.

Check the docs for the file system here.

Basically to:

  1. Save it and have it backed up, use Documents.
  2. Save it but avoid the backup, check this answer.
Community
  • 1
  • 1
Wain
  • 118,658
  • 15
  • 128
  • 151