As per the iOS Data Storage Guidelines, you have options to store data in
- Documents - User generated data (non-reproducible)
- Caches - Cached content (reproducible)
- Temp - Temporary data (needs no persistence across sessions)
- Documents with no iCloud backup attribute
Decision to choose which place to store depends on the context of the app. If the QRCode file, needs to be there and is user specific opt for option 4. The data stored in caches directory can be purged if the device runs out of disk space.
NSString *documentsDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
Please refer answer1 and answer2 for more details.
Thanks to Tommy, danh and The Tiger for making the answer more complete.