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.

Implementing shopping list data providers

Implementing shopping list data providers

- [Instructor] All right, let's continue with our quest of making our controllers more leaner. In the last lecture, what we did is we moved our core data stack initialization code into a completely separate file in a class called CoreDataManager, whose responsibility was to initialize core data manager and give us the manage object context. In this lecture, what we're gonna do is we're going to look at NSFetchResultsController, a means of fetching data from our SQL Lite database using core data. So we were gonna look at how we can make it much better and remove all this fetching portion of it, like the request portion and all of that stuff, into somewhere else, namely providers. So we're gonna add a new file, and I'm just gonna add a new save file and I'm going to call them data providers, but in this case I'm gonna call them ShoppingListDataProvider. Now, the data provider are, the whole point of having a data provider is to fetch the data. That's it. So import core data, and the…

Contents