restkit-0.20

RESTKit: Comparing GET object with locally persisted before overwriting

一个人想着一个人 提交于 2019-12-06 06:58:32
I have a saved object (persisted) in Core Data. Lets say below are the values: //Entity: employee objectID: 1111 firstName: @"Jon" lastName: @"D" modified: @"10:45PM" Now, I do a RKManagedObjectRequestOperation *operation request. I set operation.savesToPersistentStore = NO; and start the operation. The object was downloaded and it's been modified to the following: //Entity: employee objectID: 1111 firstName: @"Jonathan" lastName: @"Doe" modified: @"10:55PM" //I have 15 other properties that are either Strings, NSDate, NSNumber, and BOOLs I believe at this time the modified object is in the

RestKit: Creating stubs for foreign key relationships

筅森魡賤 提交于 2019-12-05 15:52:20
I am struggling to map the foreign key relationships returned by my JSON API with RestKit. Specifically, I use Loopback to generate an API with Entities like Team and User . There are two Endpoints by default that return the following JSON: /Teams/ [ { "title": "Team Title", "id": 1, } ] /Users/ [ { "name": "Alice", "id": 1, "teamId": 1, }, { "name": "Bob", "id": 2, "teamId": 1, }, ... ] Now this is a pretty simple API, right? It should be easy to map with RestKit, but even after reading all those other questions about the topic (e.g. Seeking recommendations for best RestKit/CoreData mapping

RestKit - Map keypath of an array to the object inside of that array

依然范特西╮ 提交于 2019-12-05 14:15:50
I really stack up parsing this particular response with RestKit 0.20: "addons": [ { "id": 1, "name": "Addon one", "version": 2 }, { "id": 2, "name": "Addon two", "version": 3 } ], "forms": [ { "id": 1, "name": "Form one", "version": 1 } ] The problem is that I need to translate the response to an array of object of the same class, such as @interface MyCoreDataObject : NSManagedObject @property (nonatomic, retain) NSString * uid; @property (nonatomic, retain) NSNumber * version; @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSString * type; @end Given that, the

Restkit 0.20 basic operation

拥有回忆 提交于 2019-12-05 06:27:29
问题 I am just getting started with RestKit and have arrived just as Rk 0.20 is going live and the documentation and demo's are a step behind. Most stuff on the web is for RK 0.10 and there are big changes in the 0.20 version. I don't want to fall back to an earlier version when the new one will very soon be up and running. I have a JSON resource at a URL "test.myserver.com" that returns a simple datagram - { "id_user": "4401", "datalocation": "4401", "country": "Great-Britain", "data": "testdata"

RestKit not deleting orphaned objects from local store

痴心易碎 提交于 2019-12-04 19:46:28
问题 Hi i have updated RestKit from 0.10.2 to 0.20.3. After updating now when objects are missing from web service, RestKit not deleting them from local storage. I know it is supported in RestKit 0.20.x, but i am not being able to configure it. I followed the example given here. http://restkit.org/api/latest/Classes/RKManagedObjectRequestOperation.html#overview I also followed similar questions on Stackoverflow. But there is no accepted answer yet. Here is my Json { "status": "Success", "member

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

♀尐吖头ヾ 提交于 2019-12-04 06:03:05
问题 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

Response mapping to get object with dynamic path restkit

五迷三道 提交于 2019-12-04 05:30:54
问题 how to i set response mapping to manager with path pattern ..if the getobjects at path is different from path pattern that is used to map the response. [manager addResponseDescriptorsFromArray: @[[RKResponseDescriptor responseDescriptorWithMapping:categoryMapping pathPattern:A keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]]]; [manager getObjectsAtPath:A/ID parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) { NSLog(

Restkit 0.20 basic operation

寵の児 提交于 2019-12-03 21:45:26
I am just getting started with RestKit and have arrived just as Rk 0.20 is going live and the documentation and demo's are a step behind. Most stuff on the web is for RK 0.10 and there are big changes in the 0.20 version. I don't want to fall back to an earlier version when the new one will very soon be up and running. I have a JSON resource at a URL "test.myserver.com" that returns a simple datagram - { "id_user": "4401", "datalocation": "4401", "country": "Great-Britain", "data": "testdata", "login": "Fred Bloggs", "password": "579c0cb0ed2dc25db121283f7a98cc71", "accessLevel": "2",

Backup core data with RestKit 0.20

别来无恙 提交于 2019-12-03 21:35:18
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 in background allow RestKit via RKManagedObjectStore to do the backup using its own MOC every 5

RestKit not deleting orphaned objects from local store

让人想犯罪 __ 提交于 2019-12-03 12:05:46
Hi i have updated RestKit from 0.10.2 to 0.20.3. After updating now when objects are missing from web service, RestKit not deleting them from local storage. I know it is supported in RestKit 0.20.x, but i am not being able to configure it. I followed the example given here. http://restkit.org/api/latest/Classes/RKManagedObjectRequestOperation.html#overview I also followed similar questions on Stackoverflow. But there is no accepted answer yet. Here is my Json { "status": "Success", "member_info": [ { "family_id": "1", "user_id": "1" }, { "family_id": "2", "user_id": "1" }, { "family_id": "3",