6

I am building universal app.In my app I am using sq-lite database.I want to sync my local data with iCloud so any other user who install app in iPhone can sync the data to his phone/Ipad.

I did search related to this on many places where I found iCloud sync with code-data but I am using sq-lite.

Is their any way to perform this action.

Thanks in Advance.

4
  • 1
    Can any one please help me out with this.I am having trouble implementing it.As my entire project is using sq-lite and at the end I can not shift my database to coredata. Commented Sep 26, 2012 at 4:36
  • you have to manually come up with a sync scheme/protocol. icloud behaves like a bucket here and is quite. dumb. CoreDataa DOES come with ready-made sync protocol, but on the lower level it isnt there Commented Nov 10, 2012 at 8:28
  • Attempting to sync a SQLite database via iCloud without something like Core Data is going to be fraught with difficulty. Think about how SQLite works - you update individual records - and how iCloud works - at the file level - and you see that marrying them is tough. Core Data does this through transaction files that are later merged. Re-creating that yourself would be... challenging. Commented Nov 11, 2012 at 19:51
  • Please Refer this Question and it's answers. Commented Dec 28, 2012 at 6:29

1 Answer 1

2

Your best bet is to implement Core Data to be able to sync with iCloud. From my research, there is no convenient way of syncing a SQLite database with iCloud without using Core Data. The advantages gained by using it go beyond accessing data. Implementing Core Data can help you work with your data more effectively because it provides a mature framework for object-relational mapping. It does have limitations such as how schema changes make existing stores inaccessible. However, it also excels in areas like support for object persistence. Overall, it can only help you to be able to use it especially with regard to synchronizing with iCloud.

There are different ways to begin converting your database to Core Data. One approach is to manually modify the SQLite database generated by Core Data once you have a model. You can determine what to change by looking at the generated database in /AppData/Documents available through the Organizer in Xcode. From there it can be a simple matter of copying your SQLite data to the new database. While this method is not recommended by Apple because they may change the Core Data schema, it can provide a means of readily migrating existing data sets. Another way is to write code to translate between the data stores within your app. You could even simultaneously maintain both implementations, SQLite and Core Data, if you wanted to.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.