restkit

Restkit .20 request timeout interval

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 12:25:27
问题 Trying to set a request Timeout Interval on Restkit. This post mentions HTTClient, but HTTPClient does NOT seem to have a way to set a timeout interval. Request timeout in restkit 0.20.0 Does anyone know how to set an interval? 回答1: There isn't direct access to it. You should really ask why you want to set a custom timeout. If you do need to change it, you should subclass RKObjectManager and override requestWithObject: . Your implementation can just call super and then edit the resulting

Backup core data with RestKit 0.20

怎甘沉沦 提交于 2019-12-21 06:24:49
问题 I am fairly new to RestKit and in general with synching core data with a RESTful web service. To simplify this I have decided to use RestKit for only backing up the local store to our rails backend. So here are two questions that are currently on top of my list: 1) What is the best practice for using RestKit to backup core data? I was thinking to create a local context that my apps uses to do all the fetch/create/update/delete operations (locally and persist them on the persistent store) Then

RestKit Mapping with an array of complex objects

天涯浪子 提交于 2019-12-21 05:22:37
问题 I had been parsing my JSON quite nicely but my server just changed on me. My JSON used to look like this: { "blobs": [ { "createdOn": "2012-03-16T15:13:12.551Z", "description": "Fake description", "hint": "And a useless hint", "id": 400, "name": "Fake CA one", "publicId": "FF6", "type": 0 }, { "createdOn": "2012-03-16T17:33:48.514Z", "description": "No hint on this one, but it does have a description.", "hint": "Hint", "id": 402, "name": "Second fake one in CA", "publicId": "FF8", "type": 0 }

Property 'managedObjectStore' not found on object of type 'RKObjectManager'

别等时光非礼了梦想. 提交于 2019-12-21 03:11:38
问题 I've been attempting to work with version 0.20.3 of the Restkit library. Recently an error has occurred that I cannot figure out how to solve. It is the following: Property 'managedObjectStore' not found on object of type 'RKObjectManager *' It happens at the line containing objectManager.managedObjectStore = managedObjectStore; A small block of my code is listed below to help with identification. I used CocoaPods to install all the necessary libraries and everything seems to link properly.

RestKit and AFNetworking build error

白昼怎懂夜的黑 提交于 2019-12-20 20:28:03
问题 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 resolve RestKit's dependency on AFNetworking? 回答1: Once cloned, simply do in the RestKit directory: git submodule update --init --recursive This will pull the AFNetworking version RestKit needs 回答2: If you use CocoaPods will do all this automaticaly.

Simple JSON login post on Restkit 0.20

一曲冷凌霜 提交于 2019-12-20 17:32:03
问题 Im following the steps of this old answer. The main issue is that RKObjectLoaderDelegate was removed and im cannot find any alternative that works for me. Im trying to connect to a server with mail/password sending a post request to a json. Also, i will be using json to get data from the database after i test this works correct. Someone can help me with this? Im using RESTkit //Autentificacion NSURL* url = [[NSURL alloc]initWithString:@"http://myurl.com/tokens.json"]; RKObjectManager*

iOS background Location not sending http request

房东的猫 提交于 2019-12-20 08:47:12
问题 My app needs to track the users location in the background but it is failing to send a 'get' request. The http request gets sent immediately when the app comes to the foreground. I am using RestKit for all my network requests and I followed this tutorial to setup my background locations service. In my applicationDidEnterBackground -(void)applicationDidEnterBackground:(UIApplication *)application { self.bgLocationManager = [[CLLocationManager alloc] init]; self.bgLocationManager.delegate =

IOS - best way to queue requests to be sent when connection is reestablished

落爺英雄遲暮 提交于 2019-12-20 04:51:14
问题 in my IOS application I have an in-app purchase in my app and I need to send receipt to my web service to assign premium content to a user account. I need this to be reliable even when the connection is lost right after the in-app purchase completes. Are there any solid libraries out there that can take a request and execute it when connection is reestablished? 回答1: I would definitely recommend AFNetworking, a very well-made networking library which wraps NSURLConnection. In order to use it

Making synchronous calls with RestKit

拥有回忆 提交于 2019-12-20 02:26:25
问题 I have an objectMapping for my entity User RKObjectMapping* userMapping = [RKObjectMapping mappingForClass:[User class]]; [userMapping mapKeyPath:@"first_name" toAttribute:@"firstName"]; [userMapping mapKeyPath:@"last_name" toAttribute:@"lastName"]; [manager.mappingProvider setMapping:userMapping forKeyPath:@"users"]; [manager.mappingProvider setSerializationMapping:[userMapping inverseMapping] forClass:[User class]]; And I want to save his profile when the application goes background: -

Core data relationship lost after fetching more objects into the entities

ぐ巨炮叔叔 提交于 2019-12-20 01:09:22
问题 I have a core data model that looks like this. Inside a tableview I load up all my appointments. On a UILabel inside my custom cell I set the appointments location name as follows. NSString *info = appointment.location.label_vrij; At first everything works Oké, but when I load more appointments into my database . All the info strings goes NULL . After some debugging I noticed that also appointment.location returns NULL . This is how my NSFetchRequest looks like RKManagedObjectStore *store = [