Cloud Kit and Core data - circumstances to use them

Hello everybody!


I am new to iOS development and I am now developing my first app. I have some questions that have to do with the right way of implmenting Core Data and Cloud Kit on my app.


Imagine that, I have Cloud Kit and core data both implmented in my app. I want to use Cloud Kit because I want my app to be available for both iPhone and iPad. So, I want the users to be able to continue their progress on all their iOS devices. But Cloud Kit requires internet conection to get data both from and to the Cloud right? If the user is not connected the data will not be saved in the Cloud. And what if the total points accumulated change on the iPhone but that was not updated on the Cloud. When the user get to the iPad the total points do not correspond to the reallity. How can I solve this conflict?


Another part of my question is ralated to the fact that I need to be able to continue playing if I dont have internet conection. So I have to use Core data in order to keep the data on the device, right?


Then, how to I combine Core data with Cloud kit?

I strongly recommend you don’t try to use Core Data for your first app. It’s difficult to use, and is likely to make your development experience both painful and discouraging.


That said, it’s hard to know what to suggest for local storage. For keeping track of progress, which is often a relatively small amount of information, UserDefaults may be sufficient. If you need to cache large assets locally, you have a much larger design problem to solve, and there’s No way to give good guidance until you have a clearer idea of what you want to do.

Cloud Kit and Core data - circumstances to use them
 
 
Q