restkit

GIT confusion with restKit

时光毁灭记忆、已成空白 提交于 2019-12-13 05:29:14
问题 So i am learning to ever so slowly use git to get me the latest update of RestKit as the old version has retain cycles...fair enough HOWEVER, when i pull using the gitHub Client it does not give me the AFNetworking files, which i was then told use the command git submodule update --init --recursive which i do, problem is that i noticed that after running that i run git submodule status It has taken me off the master branch and put the HEAD back in thus reverting me to old stuff. and hence

iOS - RESTKit 0.20 - send multiple query parameters with the same name

微笑、不失礼 提交于 2019-12-13 05:18:48
问题 I am trying to send a GET request using RESTKit that looks like this: getNames?names=bob&names=joe&names=joey When I try to set the parameters dictionary with the same key names, it don't work. Only the first key and value get sent. I know there's a question about this from a long time ago here. But there is still no answer, and I was wondering if there's any development on this. 回答1: I figured out a solution. This is the code I use: [[RKObjectManager sharedManager] getObjectsAtPath:queryPath

RestKit Mapping for different web services in different view controllers

孤街浪徒 提交于 2019-12-13 04:47:00
问题 I am developing an iPad App. I have three different view controllers wherein I call three different web services using RestKit and map them to core data entity. I display the data in all view controllers by using NSFetchedResultsController. First time when I try to load the data, it works correctly on all the view controllers. Later when I come up to the first view controller and try to load the data, it fails. I feel I am messing something. Here is my code. In AppDelegate, I initialize

RESTKit: Two EndPoints POST, PUT, DELETE

◇◆丶佛笑我妖孽 提交于 2019-12-13 04:35:28
问题 I have two EndPoints: http://rest.domain.com/invite http://rest.domain.com/template Depending on what options the User selects, I need to able to PUT , POST , & Delete on both EndPoints. Mapping for all three methods is slightly different. Mapping for each EndPoint is also different. What's the best way to setup mappings so they are loaded once and can be used multiple times for each EndPoint depending upon what option ( PUT , POST , or Delete ) the User selects? I have to accomplish this on

Restkit failure: getting access to the json returned

孤者浪人 提交于 2019-12-13 04:33:50
问题 I am using Restkit .20 and trying to get the error object returned in a failure block. I have tried both below and both return (null) for the error object. RKObjectMapping *errorMapping = [RKObjectMapping mappingForClass:[RKErrorMessage class]]; [errorMapping addPropertyMapping: [RKAttributeMapping attributeMappingFromKeyPath:nil toKeyPath:@"errorMessage"]]; RKResponseDescriptor *errorDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:errorMapping pathPattern:nil keyPath:@"error

RestKit: connecting many-to-many relationship

◇◆丶佛笑我妖孽 提交于 2019-12-13 03:56:07
问题 I've got the following Core Data model is my app: +--------------------+ +-------------+ | Ingredient | | Dish | +--------------------+ +-------------+ | id | | id | | title | | title | | dishId (transient) | +--------------------+ +-------------+ | dishes | <<--->> | ingredients | +--------------------+ +-------------+ I also have a webservice, which allows me to request all ingredients for a given dish like this: /dish/1/ingredients (where 1 is some dish id). The request to such response is

RestKit: 'NSInternalInconsistencyException', reason: 'Unable to perform mapping: No `managedObjectContext` assigned

丶灬走出姿态 提交于 2019-12-13 03:43:17
问题 I'm getting the following error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to perform mapping: No `managedObjectContext` assigned. (Mapping response.URL = https://www.someurl.com/lastrequest=2014-12-08T02%3A44%3A52Z)' The app stops at the following line in RKResponseMapperOperation.m: - (RKMappingResult *)performMappingWithObject:(id)sourceObject error:(NSError **)error { NSLog(@"managedObjectContext: %@, Source Object: %@ Error: %@",

RestKit 0.20 — Multiple query parameters with same name?

陌路散爱 提交于 2019-12-13 03:06:58
问题 I have an iOS application making use of RestKit 0.20-rc1 for RESTful services. I'm trying to perform a GET whereby I am providing multiple query parameters with the same name to retrieve a set of objects of the same type. For example, my URL would look like: http://mysite.com/rest/myobjects?objID=123&objID=234&objID=345 My web service is able to accept a query like this and return the appropriate objects. My RestKit code on the client looks something like this: NSDictionary *params = ...

iOS: RESTKit sync data with CoreData

不问归期 提交于 2019-12-13 03:04:34
问题 Setup: RESTFull API with MySQL Database in the Backend. I'm using RESTKit v.20.3 to make the API calls. I'm about to switch to Core Data. Question: If I have 10 objects in the remote database and I fetch for the first time using GET, I will get all 10 objects back and stored in Core Data locally. When I make subsequent fetch requests, how do I tell RESTKit to only download new objects only and not the same 10 objects that it downloaded earlier? Best practice approach please! 回答1: First, use

Restkit edit inserting in coredata

五迷三道 提交于 2019-12-13 02:57:42
问题 i use restkit to consume a web service ,, but when i get data i want to add some other parameters, i searched and i found that i should implement function called willsave but i don't know the way NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:brandId,@"brandId",categoryId,@"categoryId", nil]; [[RKObjectManager sharedManager] postObject:nil path:@"/mywebservice" parameters:params success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) { [self