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
11
votes
1 answer

RestKit 0.2, multiple ways to make a GET,POST,PUT request

I am getting slightly confused as to the way to use restkit, it seems like there is multiple ways to do the same thing, Before i was content just messing about with it till it worked, but now he has changed the framework and usage in 0.20.x, And I…
Genhain
  • 1,937
  • 1
  • 19
  • 38
11
votes
2 answers

How to send some data in http header with restkit

I need send some data in http header each time when I do request to server (whith get and post methods). I am using RKObjectManager from restkit. Also I need check status returned by server (401, 200, 404 e.t.c). Does anybody know the…
Radislav
  • 2,892
  • 7
  • 38
  • 61
10
votes
1 answer

RestKit Image Upload

I am using RestKit to drive interactions with my web server. I am trying to use routing to POST an Event object to the server with an image attached to it. The code is as follows: RKObjectManager *manager = [RKObjectManager sharedManager]; …
Jacob
  • 926
  • 1
  • 14
  • 25
10
votes
3 answers

How to prematurely cancel a request in RestKit and invoke 'didFailWithError'

I am using RestKit in my Objective-C project and need to specify a timeout for a call to my service of around 10 seconds. After reading around, it doesn't look like RestKit supports this, so my plan is to: Start a timer when my request is sent When…
Nick
  • 5,844
  • 11
  • 52
  • 98
10
votes
4 answers

iOS - RestKit and clearing all data?

I am using RestKit for webservice calls, caching, and etags. I implemented my own coredata model and managedObjects As soon as the user signs out I need to clear all data in the database. I was able to successfully delete the sqlite file and…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
10
votes
1 answer

Copy file with swift

I am copying a file database with this code try fileManager.copyItem(atPath: storeURL.path, toPath: storeCopyURL.path) I can see that a new sqlite database is created later, when I try to use this function try!…
j.doe
  • 4,559
  • 6
  • 20
  • 31
10
votes
3 answers

Xcode 7 linker error with RestKit and CocoaPods

I just upgraded to Xcode 7 and CocoaPods 0.38.2 and, after resolving some Swift 2 issues, got the following linker error with my mixed Objective-C & Swift project targeting iOS 7: Undefined symbols for architecture x86_64: …
pr1001
  • 21,727
  • 17
  • 79
  • 125
10
votes
2 answers

Fail to Import RestKit with Cocoapods Dynamic Frameworks

I have the prelease version of cocoapods installed, 0.26, and trying to install the latest version of RestKit. In my podfile I've turned on the use_frameworks! flag to force cocoapods to use dynamic frameworks. Putting import RestKit in my swift…
Rudy Mutter
  • 966
  • 1
  • 6
  • 16
10
votes
2 answers

Best solution to refresh token automatically with AFNetworking?

Once your user is logged in, you get a token (digest or oauth) which you set into your HTTP Authorization header and which gives you the authorization to access your web service. If you store your user's name, password and this token somewhere on…
Phil
  • 2,784
  • 2
  • 28
  • 26
10
votes
1 answer

RestKit not deleting orphaned objects from local store

Hi i have updated RestKit from 0.10.2 to 0.20.3. After updating now when objects are missing from web service, RestKit not deleting them from local storage. I know it is supported in RestKit 0.20.x, but i am not being able to configure it. I…
Khawar
  • 9,151
  • 9
  • 46
  • 67
10
votes
2 answers

RKResponseDescriptor in RESTKit is Deprecated

I'm trying to do some RESTKit http requests, and when I use the RKResponseDescriptor line of code, it says 'responseDescriptorWithMapping:pathPattern:keyPath:statusCodes:' is deprecated. Here is how I coded it: RKResponseDescriptor…
comrod
  • 343
  • 7
  • 17
10
votes
0 answers

RestKit vs AFNetworking

I am new to RestKit. Interested in knowing the difference between the two and which is better to use under which scenario.
lakshmen
  • 28,346
  • 66
  • 178
  • 276
10
votes
1 answer

How can I print the body sent by Restkit (IOS)

I'm sendind an object through RKObjectManager: [[RKObjectManager sharedManager] postObject:myObject delegate:delegate]; The mapping and route is already configured and it works successfully. It sends a json and the server receive the request, but I…
Naka
  • 1,008
  • 13
  • 14
10
votes
1 answer

RestKit delete old data from core data using setObjectMapping

I have reviewed the answer at RestKit Object Mapping: difficulty using setObjectMapping:forResourcePathPattern:withFetchRequestBlock and it is working, but only for the last mapping. Example: RKManagedObjectMapping *audioSourcesMapping =…
Kent
  • 1,374
  • 1
  • 15
  • 29
9
votes
3 answers

REST API iOS development

I'm having lots of trouble setting up the RestKit API to my app. I wonder if there is any other good API to make RESTful apps? I've just followed lots of tutorials and the github directory of the RestKit API, but I just can't get it up and running.…
JRafaelM
  • 861
  • 2
  • 10
  • 23