Questions tagged [restkit]

RestKit is an Objective-C framework for iOS that aims to make interacting with RESTful web services simple, fast and fun. It combines a clean, simple HTTP request/response API with a powerful object mapping system that reduces the amount of code you need to write to get stuff done.

A simple, high level HTTP request / response system.

RestKit ships with an HTTP client built on top of NSURLConnection and provides a library of helpful methods for inspecting MIME types and status codes. Submitting form data is as simple as providing a dictionary of parameters and a native params object is included for easily creating multi-part submissions.

Core Data support.

Building on top of the object mapping layer, RestKit provides integration with Apple’s Core Data framework. This support allows RestKit to persist remotely loaded objects directly back into a local store, either as a fast local cache or a primary data store that is periodically synced with the cloud. RestKit can populate Core Data associations for you, allowing natural property based traversal of your data model. It also provides a nice API on top of the Core Data primitives that simplifies configuration and querying use cases.

Database Seeding.

When the Core Data object store is used, you can seed a database from a collection of data files. This lets you submit your apps to the App Store with a database in the app bundle that is ready for immediate use.

Framework level support for switching servers & environments (development/production/staging).

RestKit uses a base URL and resource paths rather than full URL’s to allow you to switch target servers quickly. Interpolating URL strings and constructing NSURL objects is a thing of the past.

An object mapping system.

RestKit provides a modeling layer for mapping processed data payloads into native Cocoa objects declaratively. This lets the application programmer stop worrying about parsing and simply ask the framework to asynchronously fetch a remote resource and call the delegate with the results. Object mapping is implemented using key-value coding, allowing for quick traversal of the parsed object graph. Reflection is used on the property types to allow for mapping from remote dates encoded as a string back to NSDate objects.

Pluggable parsing layer.

RestKit currently supports JSON via the SBJSON and YAJL parsers. Parsing is implemented behind a simple interface to allow additional data formats to be handled transparently.

References

2699 questions
7
votes
2 answers

Create User in Devise from JSON

I'm working on integrating my Rails 3.1 app running Devise for user authentication with my iOS app. I'd like the user to be able to register from the application, and then I can store those credentials to login later. Using RestKit, I do…
Ethan Mick
  • 9,517
  • 14
  • 58
  • 74
7
votes
8 answers

All RestKit projects fail to build when archiving

THIS QUESTION REFERS TO RESTKIT 0.9.x. IF YOU ARE NEW TO RESTKIT CONSIDER USING THE NEWER 0.10.x branch. I recently inherited a project that uses restkit (restkit.org). I have started using a branch (402-new-build-process) that is more compatible…
Richard Stelling
  • 25,607
  • 27
  • 108
  • 188
7
votes
2 answers

RestKit primary key attribute

I load data from a json file, I save it. I do it twice ... I got two entries in my Core Data sqlite database. Even if I set in the mapping the primaryKeyAttribute. mapping.primaryKeyAttribute = @"code"; [mapping mapAttributesFromArray…
user1055083
7
votes
4 answers

RestKit ObjectMapping 2.0 tutorial needed

I'm new to RestKit and I'm looking for a good tutorial on ObjectMapping2.0. Note the 2.0 there, Blake's wonderful tutorials are dated. Googling isn't finding me anything. Have you come across one? Please share it. Thanks.
Paul Cezanne
  • 8,629
  • 7
  • 59
  • 90
7
votes
5 answers

RestKit in android?

I have used restkit framework in ios. Which is very powerful and provides features like caching and all. I am looking whether a similar framework is available in android? I came across a framework called restlet. But didnt find any samples to work…
Zach
  • 9,989
  • 19
  • 70
  • 107
7
votes
1 answer

Error: 'Unable to add mapping for keyPath news, one already exists...'

I am using RestKit to get data from a Restful Web Service. With a flat file it works great. My problem starts if I want to get the response to a nested JSON. My JSON looks like: [{"homename":"Alien","created_at":"2011-09-15T12:46:37Z",…
VanessaMartinez
  • 139
  • 1
  • 8
7
votes
2 answers

Nested to-many relationships with RestKit

I'm trying to map relationships for the following JSON to a CoreData backed model. Here's the JSON: { "photos": [ { "id": 1, "thumb": "http://localhost/test_1_thumb.png", "image":…
Soliah
  • 1,376
  • 2
  • 13
  • 24
7
votes
1 answer

RestKit mapKeyPath to Array index

I would like to map a given array index into a property with RestKit (OM2). I have this JSON: { "id": "foo", "position": [52.63, 11.37] } which I would like to map to this Object: @interface NOSearchResult : NSObject @property(retain) NSString*…
cellcortex
  • 3,166
  • 1
  • 24
  • 34
7
votes
1 answer

ResKit iOS - Register multiple classes for same Element

Hi stackoverflow community, i'm using RKObjectManager to make iOS RESTful requests to map responses to local objects. My problem with Restkit, is to register multiple classes for the same Element in different requests. In this requests i have nested…
7
votes
4 answers

Using blocks in Restkit (like ASIHttpRequest Blocks)

i have been using the block support extensively in ASIHttpRequest, and i have found it to be an extremely elegant way of coding async requests, much more so than having the delegate call back a seperate function Here is the example code for quick…
meow
  • 27,476
  • 33
  • 116
  • 177
7
votes
2 answers

RestKit RKObjectMapping Swift Optional

I have a swift model called Activity that can optionally have a coordinate attached to it. import MapKit class Activity: NSObject { var coordinate: CLLocationCoordinate2D? class func objectMapping() -> RKObjectMapping { let…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
7
votes
3 answers

Access Twitter User Timeline using Fabric SDK iOS

I am trying to struggle with this issue for two days. I am using Fabric SDK and Rest kit, trying to play with different Rest API web services for Twitter. I can login successfully using TWTRLogInButton having session object with…
NightFury
  • 13,436
  • 6
  • 71
  • 120
7
votes
1 answer

openParentApplication:reply: error with asynchronous network call in containing app

I'm getting stuck with an error when using my Watchkit Application. When I launch it, I ask the containing iOS app to get some data from network. The problem is that I get an error saying the containing app never calls 'reply()' :o But looking at my…
Bilkix
  • 327
  • 1
  • 14
7
votes
2 answers

Using Restkit with Swift

I am trying to use RestKit in my Swift based project. I do not seem to be able to use Swift primitive data types, like Int, Double, Bool and so on, except for String, Array and Dictionaries (which presumably is due to the fact, that they are…
alex da franca
  • 1,450
  • 2
  • 15
  • 27
7
votes
0 answers

Swift RestKit CoreData - RKEntityMapping nil class for class name

Using RestKit and CoreData with Swift RestKit offers functionality to map JSON directly into NSManagedObject instances. You use the following code line to init a RKEntityMapping object: var classMapping :RKEntityMapping =…
Eddz
  • 71
  • 3