I'm developing a QRCode reader app. When a qrcore is scanned I want to save it data in a file. I don't want to back it up in icloud, I just want that the data of file don't be lost when the app is closed.
so which folder should i save my data file?
thanks
As per the iOS Data Storage Guidelines, you have options to store data in
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With