RockandRoll
RockandRoll

Reputation: 411

Which is permanent storage directory in iOS?

I need to store permanently (as far as app is not uninstalled from the device), the photos that are taken from camera roll and photo library into my app's bundle. Perviously i was storing those file in tmp folder, i read that the contents of tmp folder will be purged by iOS if it finds less memory for other app to run.. so my images were not getting displayed in my app after 3 or 4 days as IOS would have purged the content of tmp folder. SO where do i need to Store these files? In Documents folder? is documents folder is permanent ?people say that you should not store huge amount of files in documents folder.. There is no limit for the photos that can be taken from my app. user may take 100 photos, 200photos, 500photos, or more than that.. its ok if user uninstall the application.. i will download all those photos in background once he login again. so what would you suggest for this problem? any kind of help is highly appreciated.

thanks

Upvotes: 0

Views: 885

Answers (2)

RobP
RobP

Reputation: 9542

You put the files in the Documents folder, or if you can download them again from Internet, in the cache folder. If in Documents folder, you must mark the files with the attribute that prevents them from getting backed up to iCloud, or your app will be rejected. Do that using this documentation:

https://developer.apple.com/library/ios/qa/qa1719/_index.html

These rules are enforced pretty vigorously by Apple and spelled out in:

https://developer.apple.com/icloud/documentation/data-storage/

(Requires iOS app developer login to view, I believe.)

Upvotes: 1

Spidy
Spidy

Reputation: 1146

What you are looking for here is SQLite. Using SQLite you can store your data and Images. For storing the Images you can refer this link

Upvotes: 0

Related Questions