I have been trying to use this tutorial.
But I want it to be saved in a thread other than the main thread. So far I cannot get the above tutorial working?
I have also tried this
Any ideas?
The next time you need to store data, you should have a better idea of your options. Core Data is unnecessary for random pieces of unrelated data, but it's a perfect fit for a large, relational data set. The defaults system is ideal for small, random pieces of unrelated data, such as settings or the user's preferences.
Use Core Data to save your application's permanent data for offline use, to cache temporary data, and to add undo functionality to your app on a single device. To sync data across multiple devices in a single iCloud account, Core Data automatically mirrors your schema to a CloudKit container.
Go to the folder add ~/Library/Developer. Search for the DB name you've created as in my case it was my.
Core Data is an object graph and persistence framework provided by Apple in the macOS and iOS operating systems. It was introduced in Mac OS X 10.4 Tiger and iOS with iPhone SDK 3.0. It allows data organized by the relational entity–attribute model to be serialized into XML, binary, or SQLite stores.
The best tutorials and documentation are the Apple's one :).
Core Data resource :
Core Data complete documentation
Core Data Starting Point
Core Data Tutorial for iOS
Core Data Model Editor Help
Core Data Snippets
Videos :
See the WWDC sessions, for example the 2013's sessions : 211.(Core Data Performance Optimization and Debugging) and 207. (What’s New in Core Data and iCloud)
Other tutorials : Many tutorials in Core Data here, cocoanetics
And a special one aboute multithreading in Core Data ( how to use multiple context) Core Data Multi-Context
Books :
Best book about Core Data, in my opinion, the Marcus S. Zarra's book. Core Data book
And also : MagicalRecord, A library that facilities the use and learning Core Data.
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