I have implemented an App which uses SQLite database, now if I run the App on a device then the database exist in that device only, now I want to use the same data on more than one device, can I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use iCloud to copy your DB between devices. There are three ways you could do this.
Implement all the file presenter coordination code by hand. This would be difficult, but your existing read/write code would stay the same.
Wrap your DB in a UIDocument. This would be much easier, but your existing code to save and load your sqlite file would need to change. Conflicts would be resolved at a per-database level.
Port your DB code to use Core Data and use a UIManagedDocument. Your entire codebase would change, but conflicts would be resolved at a much lower level.
I heartily recommend Ray Wenderlich’s tutorial series on iCloud, Beginning iCloud and iCloud and UIDocument: Beyond the basics