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

NSManageObjectContext - Class is not key value coding-compliant for the key @count

I've got an iOS app with RestKit library and CoreData. Since Xcode8, I can see way more logs than before and one of them doesn't make any sense to me. error: An observer of NSManagedObjectContextDidSaveNotification illegally threw an exception. …
Ben
  • 1,414
  • 13
  • 23
9
votes
3 answers

Handle a POST response with RestKit that is not mapped to the POST object

I have a situation where I am doing a post of an object (not a managed one, just an NSObject derived one), but the response from the REST API is not a JSON representation of the kind of object being posted. It is something else altogether. Is it…
Diego Barros
  • 2,071
  • 2
  • 33
  • 45
9
votes
3 answers

RestKit and AFNetworking build error

When I attempt to import the RestKit api into a project I get the following error: /Documents/Code/RestTest/RestKit/Code/Network/RKHTTPRequestOperation.h:21:9: 'AFNetworking.h' file not found I have installed RestKit as a git submodule, how do I…
Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
9
votes
2 answers

RestKit one-to-many inverse relationships (without CoreData)

Setup Imagine the following relationship between an Author and a Book: [Author] -- has many --> [Book] Using restkit, I have an Author model and a Book model, and I create the relationship between Author and Book like this: [authorMapping…
Kasper Munck
  • 4,173
  • 2
  • 27
  • 50
8
votes
1 answer

iOS: RestKit loadObject & send params

using loadObjectAtResourcePath on GET method, doesn't include my parameters on the requests. for example, if I send: [RKObjectManager objectManagerWithBaseURL:@"http://something/ws"]; [[RKObjectManager sharedManager]…
Alon Amir
  • 4,913
  • 9
  • 47
  • 86
8
votes
1 answer

RestKit Object Mapping Relationships without KVC

After reading the Object Mapping-Guide on GitHub for RestKit my problem didn't disappear, so perhaps somebody can say if RestKit could deal with the following idea. Entities with Relationships Company - unitID - companyID - name - contacts*…
flashfabrixx
  • 1,183
  • 9
  • 22
8
votes
2 answers

Synchronization with RestKit

I'm about to write a simple iPhone app that uses Core Data to store local copy of remote data that is fetched via RESTful web service. The data changes (new records being added) quite often. I came across RestKit and I'm wondering if it can do what…
Joe Shmo
  • 303
  • 5
  • 9
8
votes
3 answers

Ignore response when doing a postObject in RestKit for iOS

I am using RestKit for connecting to our WCF Data Services. I am having issues with adding an entity using RKObjectManager's postObject function due to response mapping issues. When an entity is added, WCF Data Services returns a 201 status code and…
Ponnu
  • 81
  • 3
8
votes
1 answer

Mapping multiple resources from one ObjectManager in RestKit

I'm writing a client for a semi-REST web service (for now it only supports GET requests). My problem is next. I have one base URL and two types of resources each one on the different resource path. By this time I have two classes that represent that…
Uko
  • 13,134
  • 6
  • 58
  • 106
8
votes
3 answers

Where's the best place to put object mappings in RestKit

I'm using RestKit for a project and i noticed that there is no longer a method in the class that you can control all mappings in (elementToPropertyMappings), i therefore wondered where the best place to put the new code was, currently i'm doing it…
8
votes
3 answers

Core Data: Store cannot hold instances of entity (Cocoa Error: 134020)

This is the strangest error. The internet suggests that this is an issue with targeting Tiger; except that I'm actually targeting iOS 3 and 4. Error Domain=NSCocoaErrorDomain Code=134020 "The operation couldn\u2019t be completed. (Cocoa error…
Evan Cordell
  • 4,108
  • 2
  • 31
  • 47
8
votes
3 answers

RestKit mapping with Rails 3.1

In Rails 3.0.8 the json contains a root element with your model name. For example my Location model. [ { location: { city: San Diego name: Mission Valley YMCA Krause Family Skatepark pads_required: 0 country: United States And the mapping…
jspooner
  • 10,975
  • 11
  • 58
  • 81
8
votes
3 answers

AWS API Gateway + Cognito User Pool Authorizer + Lambda - Which HTTP-headers and permissions do I need to set?

I have problems getting the authorization of my API on AWS for a Cognito User Pool via HTTP headers (without AWS API Gateway SDK) to work. My setup: On AWS: A REST API implemented on AWS Lambda (deployed via Serverless framework), exposed via API…
thomers
  • 2,603
  • 4
  • 29
  • 50
8
votes
2 answers

Cannot archive an iOS 5.0 era project with RestKit v0.10.3 using Xcode 7.2

I have got an old iOS project which is of iOS 5.0 era. I need to archive it using latest iOS SDK and submit it to App Store. It consists of an .pbxproj main project which uses RestKit as sub-subproject. Cocoapods is not being used at that era and…
chubao
  • 5,871
  • 6
  • 39
  • 64
8
votes
1 answer

Implicit Conversion of 'BOOL'(aka 'bool') to 'id' is disallowed by ARC

I am trying to transform a value of Pending/Completed to a boolean True/False value Here is the code for that: RKValueTransformer *transformer = [RKBlockValueTransformer valueTransformerWithValidationBlock:^BOOL(__unsafe_unretained Class…
Varun Varahabotla
  • 548
  • 2
  • 7
  • 16