restkit-0.20

How do I ignore empty properties on posted objects using restkit

丶灬走出姿态 提交于 2019-12-24 12:14:38
问题 I am reviving an old project that originally used RestKit 0.10, and now am using RestKit 0.24. The old version still works, but unfortunately RestKit 0.10 is not 64-bit compatible and hence does not submit to the AppStore (and it is certainly time to update anyway). I cannot get an object to post correctly. In RestKit 0.10, properties without values were not sent to the server, whereas it seems in RestKit 0.20 they are. I have tried explicitly setting assignsDefaultValueForMissingAttributes

Restkit mapping issue - post newly created managed object to the server

寵の児 提交于 2019-12-24 11:34:08
问题 I'm trying to post new managed object to the server by using rest kit, but I don't know what I'm doing wrong. I'm getting exception like the following: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' RKRequestDescriptor objects must be initialized with a mapping whose target class is NSMutableDictionary , got 'Users' (see [RKObjectMapping requestMapping] )' I was looking for solution in stack overflow posts like this one This is my entity mapping method from

Confusion setting mapping in RKObjectMapping - Rest

瘦欲@ 提交于 2019-12-23 20:07:43
问题 Please help in set mapping with RestKit, I am lost to find how to do this. My JSON is like { "result":{ "success":"1", "message":"You logged in successfully.", "data":{ "user_id":"1", "firstname":"somefirstname", "lastname":"somelastname", "username":"someusername", "country_id":"someid", "country_name":"somecountry", "phone":"1234567890", "status":"active" } } } What I have done so far is RKObjectMapping *loginMapping = [RKObjectMapping mappingForClass:[Login class]]; [loginMapping

Restkit: migrating to 0.20

帅比萌擦擦* 提交于 2019-12-23 12:09:56
问题 I am trying to migrate to RestKit 0.20-pre2. Currently I managed to migrate my mapping (at least the compiler does not complain anymore), but I have problems in creating requests (previously I used the RKObjectLoader which does not exist anymore. My previous code is the following: - (RKObjectLoader*)objectLoaderWithResourcePath: (NSString*)resourcePath method: (RKRequestMethod)httpMethod parameters: (NSDictionary*)parameters mappableClass: (Class)objectClass { RKObjectMapping *mapping = [self

RestKit compile fails with cocoapods use_frameworks for swift

血红的双手。 提交于 2019-12-23 07:19:09
问题 I am using RestKit along with some Swift only frameworks and when I use the cocoapods use_frameworks! flag, I get compile errors. It can't find CoreData.h in the bridging header and can't find RKValueTransformers.h If I remove the flag it all compiles correctly. Anyone else seen this? Is there a workaround 回答1: As far as I know one can only use either Objective-C or Swift libraries in the bridging-header. There is no solution enabling you to use both Objective-C and Swift libraries in the

Main thread blocked after receiving objects restkit v0.20.3

人走茶凉 提交于 2019-12-23 05:49:04
问题 Once I pull data from server it gets saved in persistent store using Entity mapping . Then I delete those objects manually . Now when I try to pull the same data again i get the error saying Mapping HTTP response to nil target object... RKObjectmapperoperation failed. Main thread get's blocked may be there managed context in rest kit is not having object graph after deleting. I am not sure how to solve this error I tried resetting persistent store. UPDATE - (void)saveThreadedContext {

RestKit - Process one REST operation at a time

别等时光非礼了梦想. 提交于 2019-12-23 04:03:17
问题 I'm using RestKit 0.20.3 and have some REST operations that needs to be done in a certain order ( the response from one REST operation needs to be included in the request parameter mapping for the next ). I tried setting up the queue to handle one operation at a time like this: RKObjectManager.sharedManager.operationQueue.maxConcurrentOperationCount = 1; And adding the operations like this: for (id insertedObject in insertedObjects) { [RKObjectManager.sharedManager postObject:insertedObject

RestKit - Process one REST operation at a time

Deadly 提交于 2019-12-23 04:02:52
问题 I'm using RestKit 0.20.3 and have some REST operations that needs to be done in a certain order ( the response from one REST operation needs to be included in the request parameter mapping for the next ). I tried setting up the queue to handle one operation at a time like this: RKObjectManager.sharedManager.operationQueue.maxConcurrentOperationCount = 1; And adding the operations like this: for (id insertedObject in insertedObjects) { [RKObjectManager.sharedManager postObject:insertedObject

RestKit: Creating stubs for foreign key relationships

烂漫一生 提交于 2019-12-22 08:13:04
问题 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

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