From the course: iOS Lean Controllers: 1 Setup, Persistent Data, and Implementation

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Integrating with Core Data

Integrating with Core Data

- [Instructor] Hi, and welcome back. In this lecture, we are going to take a look at how we can integrate core data with our application. So let's get started with that. The first thing we need to do is to initialize core data. And initializing code for core data is pretty much the same code that you will use in different projects. So instead of writing all that code, I'm simply going to copy it. So let's go ahead and copy the code. It's called initialize core data. There we go. Of course, this is going to complain, because we don't really have anything called NSManagedObject and we're not importing the module for code. Let's go ahead and do that. Import core data. Why are we using core data? Well, we are going to use core data to persist our ShoppingList as well as the grocery items into the SQLite database. Okay? Now, one thing you will notice is that I have simply added core data, or the code for initializing core data, right inside my ShoppingListTableViewController. Now, I just…

Contents