restkit

iOS - Managing two CoreData models with MagicalRecord

你说的曾经没有我的故事 提交于 2020-01-06 08:39:21
问题 I'm using MagicalRecord to work with a CoreData model, which is likely to be versioned in the future. Now I need to add to my app a pre-populated database with one entity of about 80000 objects; this data is static and I'm not expected it will ever change. If I added this entity to the existing model I would need to generate a new seed db every time the model changes, increasing the project complexity. A better solution would be creating a second model, just for the new entity: the seed db

Mapping nested IDs with RestKit in Xcode using Objective-C

不羁的心 提交于 2020-01-06 07:48:14
问题 I've got a webservice returning me a JSON formatted string looking like this : {"id":4, "name":"name", "image":1, "contacts":[2,3] } Where the contacts array contains primary key to other objects. I tried doing my mapping in this way : RKManagedObjectMapping* mapping = [RKManagedObjectMapping mappingForClass:[OETGroup class] inManagedObjectStore:[RKObjectManager sharedManager].objectStore]; [mapping mapKeyPath:@"id" toAttribute:@"identifiant"]; [mapping mapKeyPath:@"name" toAttribute:@"name"]

Mapping nested IDs with RestKit in Xcode using Objective-C

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 07:47:04
问题 I've got a webservice returning me a JSON formatted string looking like this : {"id":4, "name":"name", "image":1, "contacts":[2,3] } Where the contacts array contains primary key to other objects. I tried doing my mapping in this way : RKManagedObjectMapping* mapping = [RKManagedObjectMapping mappingForClass:[OETGroup class] inManagedObjectStore:[RKObjectManager sharedManager].objectStore]; [mapping mapKeyPath:@"id" toAttribute:@"identifiant"]; [mapping mapKeyPath:@"name" toAttribute:@"name"]

RestKit data synchronization post local-deletion issue

空扰寡人 提交于 2020-01-06 04:35:13
问题 I'm using RestKit for an app's backend. Everything is working well, however I'm running into an issue with fetching unaltered data post local deletion. This is the path matching: [self.objectManager addFetchRequestBlock:^NSFetchRequest *(NSURL *URL) { RKPathMatcher *pathMatcher = [RKPathMatcher pathMatcherWithPattern:@"cards"]; if([pathMatcher matchesPath:[URL relativePath] tokenizeQueryStrings:NO parsedArguments:nil]) return [NSFetchRequest fetchRequestWithEntityName:@"Card"]; return nil; }]

Managed object not deleted properly in my core database

一曲冷凌霜 提交于 2020-01-05 18:04:19
问题 I am trying to delete some objects from my Entity Reservation . I am doing it like this. NSManagedObjectContext *context = reservation.managedObjectContext; [context deleteObject:reservation]; NSError *error = nil; if (![context save:&error]) { NSLog(@"Error is %@",error); } After that I delete my object I fetch the whole entity again. I can see that the object is delete from my entity . But when I restart my app, all my objects that I deleted in the previous session are back stored in my

How is the RestKit related to the new Watson Conversation SDK? Linker Error?

最后都变了- 提交于 2020-01-05 09:14:10
问题 I am going to update my customised sample based on Build a home assistant mobile application with Watson and IoT Platform services I did: carthage update --platform iOS did the pod install Using the autofix for the API Changes of the Watson Conversation Parameter inside xCode Asking a question about: How to handle a concrete situation with a parameter, here on Stack Overflow And now I got a linker error and I do not now is the error related to the update of the API or is it related to a newer

5th consecutive RestKit call not being sent

天大地大妈咪最大 提交于 2020-01-05 04:54:06
问题 I'm sending an objectManager postObject call through RestKit. After 4 attempts that return 403's my 5th attempt isn't picked up and sent out by RestKit. I've verified this using Charles to watch my actual traffic, and by reviewing the RestKit logs, RestKit is getting my request and putting it in the RequestQueue, but it's never taken back out. My first 4 requests look like this in the RestKit logs (apologies for the wall of log): D restkit:RKObjectManager.m:171 CacheTimeoutSet: 60.000000 - 60

How do I setup RestKit 0.10.0 to recognize 'error' and 'errors' messages?

假如想象 提交于 2020-01-04 11:40:10
问题 Back before 0.10.0 both 'error' and 'errors' messages 'just worked' with RestKit. I see that in 0.10.0 you can set the rootKeyPath for the error mapping. objectManager.mappingProvider.errorMapping.rootKeyPath = @"errors"; However I can only set it to error xor errors. To me this seems like a regression. What am I missing? 回答1: This is what I have to manage errors: #import <RestKit/RKErrorMessage.h> ... //configure error manager RKObjectMapping *errorMapping = [RKObjectMapping mappingForClass:

How do I setup RestKit 0.10.0 to recognize 'error' and 'errors' messages?

寵の児 提交于 2020-01-04 11:38:10
问题 Back before 0.10.0 both 'error' and 'errors' messages 'just worked' with RestKit. I see that in 0.10.0 you can set the rootKeyPath for the error mapping. objectManager.mappingProvider.errorMapping.rootKeyPath = @"errors"; However I can only set it to error xor errors. To me this seems like a regression. What am I missing? 回答1: This is what I have to manage errors: #import <RestKit/RKErrorMessage.h> ... //configure error manager RKObjectMapping *errorMapping = [RKObjectMapping mappingForClass:

Object Mapping an empty response with RestKit

不想你离开。 提交于 2020-01-04 05:27:46
问题 Thanks to the help here and on the RestKit mailing list I've been able to parse my JSON, but now I have a new problem, parsing an empty response. To set the stage, here's what the JSON looks like when my query has results: {"blobsList": {"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