restkit

Delete CoreData objects after POST request

点点圈 提交于 2019-12-11 05:14:25
问题 I'm using RestKit 0.20.3 with CoreData to cache the results from my web services. I need to delete from CoreData all the objects that are not in the response so I use [RKObjectManager addFetchRequestBlock] . Everything works fine when I do GET requests but when I do POST requests the objects are not deleted in CoreData, I think because deleteLocalObjectsMissingFromMappingResult is done only with GET requests. I understand that, in a RESTfull architecture, POST requests are used to update an

Rest Kit Persistance/Performance issue with Multiplie MOCs

人走茶凉 提交于 2019-12-11 05:11:03
问题 This is the first time i've used the new version of RestKit and multiple MOC so this ones got my a little stumped. Im using RestKit 0.20-pre5 and am adding Managed Objects through RestKit operations as well as manually throughout the application. RestKits provides two MOCs to manage performance: the mainQueue and PersistantStore Object contexts. From inspecting RestKits code all new managed objects are saved to the mainQueue MOC (Based on RKObjectManager line 433 and inspection of various

Can't map an array of objects for NSManagedObject in RestKit

大兔子大兔子 提交于 2019-12-11 05:08:39
问题 I have User class which is NSManagedObject subclass: @interface User : NSManagedObject @property (nonatomic, retain) NSString * about; @property (nonatomic, retain) NSString * contactAddress; @property (nonatomic, retain) NSString * contactEmail; @property (nonatomic, retain) NSString * hobbies; @property (nonatomic, retain) NSArray* jobExperience; @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSString * surname; @end As you can see this object has an NSArray

UIImageView+AFNetworking setImageWithURLRequest uses RestKit?

孤街浪徒 提交于 2019-12-11 04:55:29
问题 I am using RestKit (0.20.0) for my Rest Api implementation - all the GETs, POSTs etc. The GETs return some urls for the images. I am using UIImageView+AFNetworking setImageWithURLRequest function to download these. I was surprised to see RestKit logs getting printed for these fetches so I did some debugging. It seems that some notification is sent by AFNetworking that eventually lands on RestKit. Looks like its happening because AFNetworkingOperationDidStartNotification is fired for the fetch

RestKit .20.x value transformation

强颜欢笑 提交于 2019-12-11 03:57:43
问题 I am new to iOS development and am trying to do some custom value transformation in RestKit, but I can't figure out how to do it. I have two current problems: I have a base64 encoded image that is returning in a JSON message from the server. It is in the below format. I am using Core Data as the backend persistent store and the 'image' field is stored in Core Data as binary data (NSData). When RestKit transforms the base64 encoded image into an NSData object, something goes wrong because the

Restkit Authorization Header disappears

孤人 提交于 2019-12-11 03:27:13
问题 I already searched everywhere and this issue that should have been trivial is taking longer than I wanted therefore I am reaching you for help. I am using swift and integrated restkit using cocoapods. Despite, as you can see the screenshots/log, the header is fine however the outgoing http packet is not consistent. AppDelegate: RKlcl_configure_by_name("RestKit/Network", RKlcl_vTrace.value); RKlcl_configure_by_name("RestKit/ObjectMapping", RKlcl_vTrace.value); ObjectManagerCode: let

using 2 versions of AFNetworking in same ios project

旧街凉风 提交于 2019-12-11 03:23:44
问题 I have a project, where Ive used AFNetworking 2.0(not as cocoa pod - just added to project) Then, I've implemented calendar MSCollectionViewCalendarLayout, which has few dependencies packaged in a pod, one of which is // 'RestKit', '~> 0.22.0' //. RestKit uses AFNetowrking 1.3 and has it packaged within RestKit. While working with calendar, I have disabled my initial AFNetworking 2.0 code, but now when i fine tuned the calendar, Ive uncommented code for Login auth(AFNetworking 2.0), and it

Parsing complex JSON using RestKit in Objective C

时光总嘲笑我的痴心妄想 提交于 2019-12-11 02:39:38
问题 I've been having issues with this issue for several days now, and would really appreciate it if someone will be able to provide some guidance or even a full code solution for this. I'm trying to perform dynamic object mapping to a JSON string in Objective C using RestKit and can't seem to get the right values. This is an example to the kind of JSON response I need to parse: { "Boy" : { "favoriteClass" : "math", "basicInfo" : { "name" : "John", "age" : 10, "type" : 1 } "friends" : [ { "Boy" :

RestKit : How to manually set the value of a managed object property?

女生的网名这么多〃 提交于 2019-12-11 02:36:10
问题 How to manually set the value of a managed object property in RestKit when it's managed by the object manager ? I created a RKObjectManager with a persistent store for core data persistence. I added a RKEntityMapping and a RKResponseDescriptor to the object manager. Now I can call to object manager like this : [[RKObjectManager sharedManager] getObjectsAtPath:@"/path_to_ressource" parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) { // success }

Basic Authentication using Restkit

Deadly 提交于 2019-12-11 01:50:16
问题 I am trying to do Basic Authentication using RestKit but I need some help with figuring out why I get status code 401(Unauthorized). I tried this, but it did not work for me. I will appreciate if someone can point out my mistake. This is what my data looks like on the server side: Sample { "Id": "baec6f47", "TokenValidity": "00:00:00.1234567", "ValidTo": "2013-10-28T23:54:21.2934278+00:00", "Parameters": {}, "Token": "sample string 3" } I have a NSObject class called TokenObject, and that