Tag: restkit

RestKit Relationship Mapping by ID in URL

Assume I have an API at users/1/items that returns a list of items for the user with an ID of 1. Assume the API response is as follows: { “items”: [ { “id”: “1”, “description”: “Some item” } ] } Note that the response does not contain a user_id for relationship mapping. Is it possible […]

RestKit – Post object and update its attributes

I have a small app using RestKit with a Sinatra-backed server. When I post a user object to the server, the server successfully saves the user and responds with a json representation of the newly created user. Here’s the code to create a user on the client: User *currentUser = [User currentUser]; currentUser.email = @”jacob@mail.com”; […]

RestKit – fetchFromDataStore (cache) issue

I were looking at RestKit framework and how it works. Then I create simple project that will call Github api and load the data into a tableview – after some tutorials I have read -, regarding loading and mapping from remote it works fine and loaded to the tableview but when when I’m trying to […]

Send JSON request with Restkit RKParams

I need to send a JSON request to a REST service. I’m using Restkit RKParams to send a request. Currently it works as follows: [params setValue:@”-46.566393″ forParam:@”checkin[lng]”]; [params setValue:@”-23.541576″ forParam:@”checkin[lat]”]; Send: { “checkin”: { “lng”:”-26.566393″, “lat”:”-63.541576″ } } Now I want to form JSON data like this (with few more items): { “checkin”: { “lng”:”-26.566393″, […]

Target Integrity – The file “Pods-ios.xcconfig” couldn't be opened because its path couldn't be resolved. It may be missing”

I’m trying to utilize the four Examples that ship with RestKit Version 0.20.1 Currently trying to Build RKSearchExample. The Build “succeeds” but no simulator appears and I get two warnings 1st one – Target Intergrity – The file “Pods-ios.xcconfig” couldn’t be opened because there is no such file. …. 2nd one – Target Integrity – […]

Why does RKNSJSONSerialization crash on iOS 6?

I’m seeing a crash in RKNSJSONSerialization on iOS 6 only – not on iOS 7. I’m using RestKit 0.20.3 and it happens fairly consistently for me. Even when I make the same request and get the same response for iOS 6/7, it works fine on iOS 7 but crashes on iOS 6. Here’s the crash […]

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 category method and is imported like this: #import “NSString+MD5.h” However, in one project, […]

is it possible to install AFNetworking 2.0 with Restkit

I got an news app which fetches news online in XML format in stores it locally in the sqlite dbase.. which is perfect case for restkit. However, I would like to also fetch xml data manually sometimes (ie and not want to store it in the dbase).. in other words i would like to request […]

RestKit: JSON mapping doesn't work

how should the mapping look like if I’ve got a JSON-response like this: { “persons”:{ “@size”:”4″, “person”:[ { “name”:”John”, “type”:”Doe 1″, “options”:”some options” }, { “name”:”John”, “type”:”Doe 2″, “options”:”some other options” }, { “name”:”John”, “type”:”Doe 3″, }, { “name”:”John”, “type”:”Doe 4″, } ] } } I already tried the following mapping, but it doesn’t work: […]

Implementing object mapping using RestKit in Objective-C

I am having trouble mapping a JSON response to objects using RestKit and Objective-C. I have already set up my RKObjectManager and mappings in my AppDelegate as suggested in my previous post by mja. I call my backend in my controller as per the example below. There are two issues I’m having trouble with: [[RKObjectManager […]