Skip to Main Content
Core Data in Objective-C, 3rd Edition
book

Core Data in Objective-C, 3rd Edition

by Marcus S. Zarra
June 2016
Beginner to intermediate content levelBeginner to intermediate
240 pages
6h 17m
English
Pragmatic Bookshelf
Content preview from Core Data in Objective-C, 3rd Edition

Building an NSFetchRequest

NSFetchRequest is the part of Core Data that causes people to think it’s a database API instead of an object hierarchy. When we want to retrieve objects from Core Data, we normally use an NSFetchRequest. It’s best to view an NSFetchRequest as a way to retrieve all instances of an entity from the object hierarchy, with the option to filter results with an NSPredicate. There are two parts to the creation of an NSFetchRequest: setting the entity to be retrieved and optionally defining an NSPredicate to filter the objects we want retrieved.

Setting the Entity

One thing that we must do as part of every NSFetchRequest is define the entity we want returned from the fetch. We do this by passing the appropriate NSEntityDescription ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

iOS Programming Cookbook

iOS Programming Cookbook

Hossam Ghareeb
Learning Cocoa with Objective-C, 4th Edition

Learning Cocoa with Objective-C, 4th Edition

Paris Buttfield-Addison, Jonathon Manning, Tim Nugent

Publisher Resources

ISBN: 9781680502022Errata Page