Book Image

RestKit for iOS

By : Taras Kalapun
Book Image

RestKit for iOS

By: Taras Kalapun

Overview of this book

<p>RestKit is an iOS framework for streamlining communication with web services, and it relies on the AFNetworking library that is used by thousands of app developers. It has an interface that is elegant and well designed, and it provides a powerful object-mapping engine that integrates well with the CoreData database. RestKit for iOS will teach you everything from loading a simple list of objects to creating a fully-featured app.<br /><br />RestKit for iOS delivers constructive tools and insights into app development that will benefit any app developer. The book starts with a simple example and then moves on to more complex ones as your knowledge increases. By the end of the guide, you will be able to build a fully-featured app that uses RESTful web services and performs CRUD object manipulation.<br /><br />RestKit for iOS will provide you with all the information you need to boost the development process of both simple and complex apps. Once you have executed a simple example and reviewed the basic theory, you will move on to more advanced concepts with descriptions of real-life scenarios and how to overcome bottlenecks. RestKit for iOS is full of real-life examples that show you how to simplify data loading, basic and advanced object mapping, metadata mapping, and routing. This book also teaches you about routing, RESTful object manipulation and synchronization, integration with the user interface, and caching</p>
Table of Contents (13 chapters)

Chapter 3. Persistence with Core Data

This chapter describes how to make an application use persistence data using Core Data. For our example, we will make Database and Collection elements to be backed by Core Data in our application. We will leave Documents out of Core Data, as they are more dynamic, and by this, we will see how to deal with a hybrid environment, where some objects are backed by Core Data, and some are not.

The idea is as follows—when an application is started, we will ask RestKit to refresh information about our database and collection objects. In this procedure, RestKit will determine the changes on a server in this data, and will sync our database to those changes. We assume that the information in the web service is the most correct and the latest.

Later on, we will use the cached information from our database, and we will refresh it manually or at the start of the next application, when the user will trigger the Pull to refresh action in table view. This will give us...