O'Reilly logo

RestKit for iOS by Taras Kalapun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Indexing and searching

RestKit includes a component for easily indexing and searching Core Data entities. It can greatly help in implementing search functionality on a large database. This component is not included by default if RestKit is installed via CocoaPods. So in order to use it, you need to install it as a submodule. Add pod 'RestKit/Search' to the Podfile and hit pod install in a terminal.

Before using the indexer, it needs to be configured. You start by importing RestKit/Search.h headers and adding search indexing for each entity you plan to search:

RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel]; // Configure indexing for the Collection entity NSArray *attributesToSearch ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required