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 RKObjectMapping nested json

How can I map the nested json below with RestKit RKObjectMapping? I only need to map the "data". My current code below returns (null) - Thanks! { "sucess": true, "error": { "code": "", "message": "" }, "data": [ …
steamboy
  • 1,162
  • 5
  • 20
  • 37
6
votes
3 answers

Best practice for temporary objects in RestKit with Core Data

Background: I have a managed object, Car. I have a RESTful search API sitting on localhost/cars/search. The returned results are Car objects from the server side, but I only want to save the one the user chooses. The rest of the Cars I want to…
Eric G
  • 1,429
  • 18
  • 26
6
votes
2 answers

Load images from NSURL async with RestKit

Is there a wrapper or some sort of built-in functionality available in RestKit to load a UIImage from an NSURL asynchronously using callbacks or blocks? I could not find such a method in the RestKit docs. If there is not, what is a good strategy for…
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
6
votes
1 answer

Is it possible to set the django-tastypie objects key?

By default, when using django-tastypie and fetching a resource list, the response is of the format: { "meta": { "limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 3 }, …
shawnwall
  • 4,549
  • 1
  • 27
  • 38
6
votes
1 answer

Restkit [NSManagedObject managedObjectContext] returns different instances

I have serious problems since I migrated my core data logic to RKManagedObjectStore. I setup a NSFetchedResultsController with the context set to [NSManagedObject managedObjectContext] within the main thread in the view controller: assert([NSThread…
Sbhklr
  • 2,693
  • 1
  • 17
  • 20
6
votes
2 answers

Restkit-loaded nested Core Data entities cause NSObjectInaccessibleException

I'm using RestKit to grab objects from my RoR service and using CoreData to persist some of the objects (more static-type lookup table objects). TasteTag is one of those persisted objects: #ifdef RESTKIT_GENERATE_SEED_DB NSString…
Parrots
  • 26,658
  • 14
  • 59
  • 78
6
votes
2 answers

Objective-C category is not loaded - How to debug this

I have two projects which the RestKit framework. One project works without problems but another project fails, as soon as the RestKit framework is used. I found out that the failing code is this: return [anNSString MD5]; The MD5 method is a…
Besi
  • 22,579
  • 24
  • 131
  • 223
6
votes
2 answers

How to POST an object to rails using RestKit?

I'm trying to make the magic happen with RestKit and Rails. I'm using Rails 3.1.1, and RestKit 0.9.3 (not the master branch). I am using Core Data in my iOS app, so I'm trying to setup the app to use as much RestKit magic as possible to interact…
Ethan Mick
  • 9,517
  • 14
  • 58
  • 74
6
votes
1 answer

Error with loading objects from a Response(RestKit)

I created a mapping for the rest Response and named it Data.After making the rest call through RKObjectManager,it is not loading the objects.Instead it is executing the didFailWithError method of RKObjetLoader.My implementation class inherits from…
Anusha Pachunuri
  • 1,389
  • 4
  • 18
  • 39
6
votes
1 answer

Restkit returning 0 Objects in objectLoader: didLoadObjects:

So I am trying to get back an array of Leaderboard objects from a database using rest calls. didLoadObjects returns 0 objects even though the mapping seems correct: RKObjectManager *svc = [RKObjectManager sharedManager]; NSString *resourcePath =…
Endama
  • 743
  • 8
  • 25
6
votes
1 answer

How do I use basic auth with RestKit's getObject?

I tried the following to set the basic auth username and password, but it does not seem to be passing the basic auth in the request.. secureManager = [[RKObjectManager objectManagerWithBaseURL:@"http://localhost:3000"]…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
6
votes
3 answers

Where to put object mappings (in RestKIt)

As I don't want to hijack another thread here comes my question about mappings. First read: Where's the best place to put object mappings in RestKit I'm sure that the answer Blake Waters gave will probable be very correct as he is a much smarter and…
Glenn
  • 2,808
  • 2
  • 24
  • 30
6
votes
4 answers

How do third-party libraries work in Objective-C and Xcode?

Pretty new (2 weeks) into Objective-C and Xcode, and I'm trying to add my first "external" library, namey restkit, to read some JSON from an external server. However, looking at their "getting started" guide, from what I understand you just download…
Mathias
  • 3,879
  • 5
  • 36
  • 48
6
votes
2 answers

RestKit warning: "Found a collection containing only NSNull values..."

I have a RestKit-based app with one mapped class. Everything seems to work fine. However, when I retrieve objects, RestKit emits a warning: W restkit.object_mapping:RKObjectMapper.m:90 Found a collection containing only NSNull values, considering…
Jan Dudek
  • 807
  • 1
  • 9
  • 17
6
votes
2 answers

Can I still use xcdatamodel core data model relationships with Restkit?

As I understand it RestKit provides integration with Apple’s Core Data framework, making and populating Core Data associations for you, allowing natural property based traversal of your data model. However, I am unsure if I can still use xcdatamodel…
zardon
  • 2,910
  • 6
  • 37
  • 58