restkit-0.20

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

只谈情不闲聊 提交于 2019-12-03 09:28:25
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. #import "AppDelegate.h" #import <RestKit/RestKit.h> #import <RestKit/CoreData.h> #import <CoreData

Transition from RestKit to pure AFNetworking 2.0

爱⌒轻易说出口 提交于 2019-12-03 06:47:50
问题 I'd been using RestKit for the last two years, but recently I've started thinking about transition from these monolith framework as it seems to be really overkill. Here's my pros for moving forward: There is big need in using NSURLSession for background fetches and RestKit has only experimental branch for transition to AFNetworking 2.0. No actual dates when transition will be finished. (Main Reason) No need for CoreData support in network library as no need for fully functional offline data

Simple JSON login post on Restkit 0.20

人盡茶涼 提交于 2019-12-03 03:56:54
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* objectManager = [RKObjectManager managerWithBaseURL:url]; objectManager = [RKObjectManager managerWithBaseURL

RestKit 0.20 — What is the preferred way to create a new NSManagedObject?

这一生的挚爱 提交于 2019-12-03 03:15:45
I'm curious to know what the best way is to create a new NSManagedObject in RestKit 0.20? Currently my code looks something like this: #pragma mark - navigation buttons - (void)createButtonDidTouch { // create new album object NSManagedObjectContext *context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; NSManagedObjectContext *parentContext = RKObjectManager.sharedManager.managedObjectStore.mainQueueManagedObjectContext; context.parentContext = parentContext; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Album"

Trying to make a POST request with RestKit and map the response to Core Data

半城伤御伤魂 提交于 2019-12-03 02:06:41
问题 I am using RestKit framework and i want to make a POST HTTP request. The response is JSON. I want to put the JSON response automatically in the CoreData. I don't know exactly what methods to call to make the request. I know that I should use RKObjectManager 's methods but I didn't find the right one. I found this method postObject:delegate: but I don't what the object to pass as parameter. I also find this method in documentation: loadObjectsAtResourcePath:usingBlock: but I can't use it

Transition from RestKit to pure AFNetworking 2.0

北城以北 提交于 2019-12-02 20:24:41
I'd been using RestKit for the last two years, but recently I've started thinking about transition from these monolith framework as it seems to be really overkill. Here's my pros for moving forward: There is big need in using NSURLSession for background fetches and RestKit has only experimental branch for transition to AFNetworking 2.0. No actual dates when transition will be finished. (Main Reason) No need for CoreData support in network library as no need for fully functional offline data storage. Having headache with new concept of response/request descriptors as they don't support

Trying to make a POST request with RestKit and map the response to Core Data

拟墨画扇 提交于 2019-12-02 15:40:46
I am using RestKit framework and i want to make a POST HTTP request. The response is JSON. I want to put the JSON response automatically in the CoreData. I don't know exactly what methods to call to make the request. I know that I should use RKObjectManager 's methods but I didn't find the right one. I found this method postObject:delegate: but I don't what the object to pass as parameter. I also find this method in documentation: loadObjectsAtResourcePath:usingBlock: but I can't use it because it tells me: No visible @interface for 'RKObjectManager' declares the selector

RestKit RKMappingTest JSON array

纵饮孤独 提交于 2019-12-02 12:13:21
问题 I'm using RestKit ~> 0.20.3 and RestKit/Testing ~> 0.20.3. So this is an example of my mapping: RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[PlayerVO class]]; [mapping addAttributeMappingsFromArray:@[@"firstName", @"middeName", @"lastName", @"dob", @"sex"]]; This is my mock data: NSDictionary *data = @{@"players": @[@{@"firstName": @"Ahmed", @"middleName": @"Ahmed", @"lastName": @"Ahmed", @"dob": @"100", @"sex": @"m"}]}; This is my mappingTest : RKMappingTest *mappingTest =

Will RestKit's dynamic mapping solve this complex JSON mapping?

爱⌒轻易说出口 提交于 2019-12-02 11:38:02
I am using RestKit in my app, which needs to use an existing synchronization service that structures the incoming data this way: { "timestamp": 000000000001, "status" : 0, "syncData":[ { "errors":[], "rows":[ {"name":"AAA", ...}, {"name":"BBB", ...}, ...], "rtype":"FOO" }, { "errors":[], "rows":[ {"id":1, "description":"ZZZ", ....}, {"id":2, "description":"YYY", ....}, ...], "rtype":"BAR" }, ... I'm new to RestKit and trying to figure out the best way to solve this problem, and the complementary problem of sending this same structure of data back to the server. I'm using Core Data with RestKit

Feeding parsed data to RKMapperOperation throws NSUnknownKeyException

假如想象 提交于 2019-12-02 06:52:21
问题 See my other question for background: Will RestKit's dynamic mapping solve this complex JSON mapping? Due to the way the server structures the json data that I need to convert into NSManagedObject s, I'm passing the parsed json to do a direct object mapping, like so: RKObjectMapping *mapping = [RKObjectMapping requestMapping]; [mapping addAttributeMappingsFromDictionary:@{@"id": @"id", @"name": @"name"}]; NSDictionary *mappingsDictionary = @{ [NSNull null]: mapping }; RKMapperOperation