Data
The DATA
section will have two methods that rely on different fetch request templates. Each fetch request template will be configured to look for a home or shop location with the exact name ..Unknown Location... The leading dots will ensure that this location is located at the top of the table view, due to the sort descriptor of the fetch.
Update Grocery Dude as follows to configure the new fetch request templates:
1. Select Model 6.xcdatamodel.
2. Add a fetch request called UnknownLocationAtHome.
3. Add a fetch request called UnknownLocationAtShop.
4. Configure the UnknownLocationAtHome fetch request template to fetch all LocationAtHome objects where storedIn is ..Unknown Location.., as shown in Figure 6.9. You’ll need to click the + to ...
Get Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.