In this video you will become familiar with perhaps the simplest model to work from. It is not very performant for large inserts, but will fit the bill for most applications that don't require a data intensive layer.
- View Offline
- [Instructor] This DataLayerSimple…is going to contain all the calls that we need…to the database.…First let's begin by just adding a few variables.…We're going to set a pageSize of 10 persons,…we're going to get a pointer to the mainContext,…just to make things easier to work with,…and then we're also going to make this people array…that we're going to return to the View Controller.…Next, we're going to setup a way to get the number of results…and all this is going to consist of is this fetchRequest…and then we're going to execute it,…we're actually going to get a count from the mainContext…and we'll just return that result.…
All right and then we're going to…implement our setupCoreData() method that we talked about.…And this is just going to have a function within a function…and these just help you keep code organized…within larger tasks.…And really within here, we just need to create the people…and query how many people were actually inserted…into the database.…So let's go ahead and implement those…and see what they look like.…
This course is meant for the enterprise developer who wants to get up to speed with the latest methods with Core Data. Instructor Jon Bott starts with a review of the basics, explaining the different architectural data models currently in use, the issues that can arise from these different models, and how the latest changes in Core Data 2016 simplify these models. He wraps up with hands-on migration to the new APIs and further tips on leveraging them in iOS 10 and macOS 10.12 apps.
- Fetching data
- Working with objects, queues, and threads
- Understanding the architectural models
- Managing local and server-side data
- Understanding iOS 10 and macOS 10.12 updates to Core Data
- Migrating to the new core data