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

Integrating with UI

Previously, we used NSArray to store the response data and to show it in UITableView. With Core Data entities, the best approach is to use NSFetchedRequestController. The benefit of using it is its ability of lazy loading objects, as well as responding to Core Data changes on fetched objects.

Let's modify our GenericTableViewController to support Core Data in addition to in-memory objects. We will start by defining a few additional properties:

@property (nonatomic, assign) BOOL useCoreData; @property (nonatomic, assign) Class objectClass; @property (nonatomic, strong) NSString *sortBy; @property (nonatomic, strong) NSString *groupBy; @property (nonatomic, strong) NSPredicate *fetchPredicate; @property (nonatomic, strong) NSFetchedResultsController ...

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