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

RestKit 0.20 nested object mapping trouble using API

I'm getting the titleForHeaderInSection correctly, where its pulling the leaf. But getting nothing for themes. I'm guessing my mapping to themes is not working, because cellForRowForIndexPath doesn't seem to be getting called when I set breakpoints.…
Realinstomp
  • 532
  • 2
  • 13
  • 30
7
votes
1 answer

RESTKit POST Request Tutorial

I would like to know if there is a specific tutorial on how to do a POST request with RESTKit. I have looked at some tutorials but I haven't found any that say, "This is exactly how you do a POST request with RESTKit." Help is much appreciated.
comrod
  • 343
  • 7
  • 17
7
votes
4 answers

RESTKit object BOOL property to true/false JSON

I have some objects which I'm sending to a server as JSON, in the request body, for a POST request. My question relates to boolean properties. Say I have this property in an object I'm sending as JSON: @property (nonatomic) BOOL exported; By…
Diego Barros
  • 2,071
  • 2
  • 33
  • 45
7
votes
1 answer

Core Data inconsistency - fetch sometimes returns nothing

I've already spent few hours on that one and I can't seem to find a solution. First, some specifications of what do I have: Objective-C iOS 6 app with Core Data Core Data is initialized from UIManagedDocument, which has auto-saving turned…
mav
  • 1,230
  • 1
  • 15
  • 23
7
votes
1 answer

persistentStoreManagedObjectContext vs mainQueueManagedObjectContext

Good evening! So I've been having some trouble understanding what the hell is going on while saving my data in Core Data. First of all, a quick question: 1) When should I be using the persistentStoreManagedObjectContext and when should I be using…
abisson
  • 4,365
  • 9
  • 46
  • 68
7
votes
4 answers

Can not delete an entity from Core Data, using RestKit 0.20

The code below does not delete the entity. The "delete was successful" message appears on the console so the entity is found. All other operations I use succeed. I am using RestKit 0.20. NSManagedObjectContext *context = [RKManagedObjectStore…
zaph
  • 111,848
  • 21
  • 189
  • 228
7
votes
2 answers

RestKit crashes because NSManagedObjectContext is nil in the RKResponseMapperOperation

I'm working on my diploma project, which includes an iOS client with a Core Data database and a Ruby on Rails server. I'm using RestKit for the communication between them. Currently I'm having a big issue getting the whole system to work: as I try…
7
votes
2 answers

Error that RestKit.h was not found

I’m not certain that this is a RestKit issue, and I’ve tried reinstalling RestKit via CocoaPods many times, but eventually I get this error: file not found Everything compiles fine, and RestKit works. I've set the header search…
mkral
  • 4,065
  • 4
  • 28
  • 53
7
votes
3 answers

RestKit Response Can't Be Deserialzed to Object

I'm having trouble mapping a response back to an object during a post request using RestKit. Here's the code: Request: // mapping for the response. response is an object: {"response":"message","success":bool} RKObjectMapping *responseMapping =…
threejeez
  • 2,314
  • 6
  • 30
  • 51
7
votes
1 answer

How do I set basic authentication with RestKit 0.20.0?

I'm trying to use RestKit to call an endpoint that requires basic authentication. RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[JSNCategory class]]; [mapping addAttributeMappingsFromDictionary:@{ @"id": @"catId", @"name":…
Brett Ryan
  • 26,937
  • 30
  • 128
  • 163
7
votes
3 answers

RestKit Dynamically Map Relationship Name based on Value

I am using RestKit to parse JSON and map it into Core Data NSManagedObjects. Here is a sample JSON. { "events": [ { "description": "...", "subject_type": "photo", "subject": { "id": 1, …
brynbodayle
  • 6,546
  • 2
  • 33
  • 49
7
votes
2 answers

How to convert a Json String into a NSArray?

I am currently trying to convert the JSON Representation of some Objects into an NSArray. I used RestKit to get the Response through our API and now I want to convert the RKResponse into an Array of Objects. How can I do this ?
Sebastian Boldt
  • 5,283
  • 9
  • 52
  • 64
7
votes
2 answers

Restkit MultiForm Post with an Image

Problem I've been trying to post to the server with a multiform request that includes an image attachment. I haven't had trouble getting the image to the server, it is the other information that is not sending correctly. Details I'm using object…
Rob Caraway
  • 3,856
  • 3
  • 30
  • 37
7
votes
3 answers

RestKit Timeout Being ignored

I am calling a webservice from my iOS app which can take up to four minutes to return. I am using RestKit for the call and loading of the objects. What I'm finding is that when the requests are taking a long time, I get a Timeout error after ~60…
Michaela
  • 493
  • 5
  • 19
7
votes
3 answers

iPhone RestKit how to load a local JSON file and map it to a core data entity?

I'm building a two way dropbox sync app. I load objects from core data, convert them to JSON and send them over to dropbox. However, when I do sync, I compare a set of local JSON files to the dropbox JSON files. If a conflict is detected, a sync…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407