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)

Database seeding


In the context of Core Data, seeding means shipping your application with a persistent store pre-populated with default data. There are two ways to seed a database:

  • On the initial app start, copy the pre-populated database from the application's bundle

  • Seed the newly created database with data from JSON, XML, or another source

The second way is not the best, as seeding from a source will require parsing, mapping, and inserting operations that will slow down the application start, thus giving negative user experience. But this way can be used to create a seed database on the developer's machine.

You usually configure database seeding by copying an existing target to a new one that will be used to generate the seed database. The main differences between the targets are:

  • GENERATE_SEED_DB is defined in the target's build section Preprocessor macros. This will trigger the seed database to be built.

  • Seed source files are added to the target in order to be copied in the application...