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

Batching operations

Suppose we want to import and upload a CSV file in our remote database. An example can be IMDB (International Movie Database), the top 250 movies CSV table, each row containing title, rating, and the number of votes. We need to post every single movie as a document in our collection as follows:

...
241,8,Mystic River (2003),"234,310"
242,7.9,Manhattan (1979),"71,126"
243,7.9,The Untouchables (1987),"152,716"
244,7.9,"Spring, Summer, Fall, Winter... 38,532"
245,7.9,Nosferatu (1922),"49,200"
246,7.9,The Celebration (1998),"43,066"
247,7.9,Three Colors: Red (1994),"39,541"
248,7.9,Big Fish (2003),"263,070"
...

Luckily, RestKit has a batch operation method. So to enqueue a batch of object request operations, we would write the following ...

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