restkit

No Request will send if app is in background mode Optionen

不羁岁月 提交于 2019-12-12 06:01:41
问题 With a trick it is possible to run the app, if the home button is pressed. In the background mode, no request with RKRequestQueue will be send, so the app receive no response from backande server and the app can't update the data. 回答1: This is standard behavior. When the app becomes active (i.e. is running and no longer in the background), you may want to implement the -(void)applicationDidBecomeActive:(UIAplication *)application method in your application delegate which would resume where

RestKit 0.20: How to POST/GET more than 1 managed object without a wrapper class?

喜欢而已 提交于 2019-12-12 04:38:44
问题 Currently I have several instances where I need to send a group of objects to the server: { "things": [ { //object stuff }, { //object stuff }, ... ] } So what I've been doing is defining an intermediate object MyThingPayload @interface MyThingPayload @property (nonatomic, strong) NSArray *things; @end And then when mapping RKObjectMapping *mapping = [RKObjectMapping mappingForClass:NSClassFromString(@"MyThingPayload")]; [mapping addPropertyMapping:[RKRelationshipMapping

What will be if I call simultaneously [[RKClient sharedClient] get@“foo.xml” delegate:self] in two UIViewControllers?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 03:59:09
问题 What will be if I calls simultaneously [[RKClient sharedClient] get@"foo.xml" delegate:self] in two UIViewControllers? Do I have any problems? viewController_A { [[RKClient sharedClient] get:@"foo.xml" delegate:self]; } viewController_B { [[RKClient sharedClient] get:@"foo.xml" delegate:self]; } 回答1: If you have a look at the RKClient implementation for get:delegate: it simply does this - (RKRequest *)get:(NSString *)resourcePath delegate:(id)delegate { return [self load:resourcePath method

RestKit many to many relationship saves new rows in both join table and null values in main table

醉酒当歌 提交于 2019-12-12 03:43:02
问题 I use RestKit to cache data from a remote server locally. In it I have a many to many relationship between Category <<-->> News. The mapping seems to work properly, despite that it also saves null values in my Category table (it saves the correct categories too). Like the image below: It seems to save 30 null rows, I also have 30 (not null) rows in my join table so there might be a correlation here. The JSON that I get looks like this: "categories":[{"category_id":1},{"category_id":4}] I have

RestKit Post Failure managed object store is nil

岁酱吖の 提交于 2019-12-12 03:42:57
问题 I am trying to POST to a server via RestKit, and while the post is added to the tableView, it doesn't save to the server and I get this error in the xcode console log 2013-06-20 11:08:44.522 App[9653:c07] W restkit:RKObjectManager.m:577 Asked to create an `RKManagedObjectRequestOperation` object, but managedObjectStore is nil. But I believe I setup the managedObjectStore in my appDelegate. I have this: NSError *error = nil; NSURL *modelURL = [NSURL fileURLWithPath:[[NSBundle mainBundle]

Restkit request load handler

两盒软妹~` 提交于 2019-12-12 03:34:45
问题 As i see in all RestKit documentations, didWSRequestLoadObjects delegate function is used to handle service response. The problem is, if I have a different requests ( postObject ) in my view controller i have to check response type in didWSRequestLoadObjects for each request. Is there a way to register a function before each postObject and get each response in different function? 回答1: Which version of RestKit are you using? On the last release it is highly encouraged to use blocks instead of

RestKit RKDynamicObjectMapping work only for first JSON result

痴心易碎 提交于 2019-12-12 03:08:24
问题 i got into an issue with RKDynamicObjectMapping , however it could be that i misuse it. I have the following scenario request to the service to get areas choose area request to the service to get journals for selected area data returned by both calls looks like that { d: [{cutID:""}, {cutID:""}, {cutID:""}] } { d: [{journalID:""}, {journalID:""}, {journalID:""}] } i have the following code RKObjectMapping* cutMapping = [RKObjectMapping mappingForClass:[Cut class]]; [cutMapping mapKeyPath:@

JSON format inconsistency

断了今生、忘了曾经 提交于 2019-12-12 03:02:52
问题 There are two JSON format that i came across: Format A: [ {"topic": {"category":"testCategory","created_at":"2011-09-27T05:41:42Z", "size":5,"title":"testTitle2", "id":1, "posts":[ {"number":1,"created_at":"2011-09-27T05:41:42Z", "text":"text2","id":1,"topic_id":1}, {"number":0,"created_at":"2011-09-27T05:41:42Z", "text":"sentence1","id":2,"story_id":1} ] } } ] Format B: [ {"category":"testCategory","created_at":"2011-09-27T05:41:42Z", "size":5,"title":"testTitle2", "id":1, "posts":[ {"number

Restkit mapping - Works in simulator, not on iPad

醉酒当歌 提交于 2019-12-12 02:57:20
问题 I have been building this project for months, testing on both the simulator and the iPad with no issues like the one I'm having right now. All of a sudden, I can no longer map objects from my Rails application to Core Data upon a successful GET request ON MY IPAD. I am having no issues on the simulator. When the app launches, I am making a large GET request if there isn't any data in Core Data. Here is what RestKit logs in the successful case (aka while using the simulator): 2014-09-12 17:32

Restkit property mapping Failed Transformation error

懵懂的女人 提交于 2019-12-12 02:45:15
问题 this is what my sample code looks like: { "name": "Ahmad Mansour", "subjects": [ { "parent_subject_name": "Arabic", "subject_name": "Shafahi", "exams": [ { "score": "30.00", "exam_name": "Sa3i 1 " }, { "score": "50.00", "exam_name": "sa3i 2" }, { "score": "100.00", "exam_name": "First Semester Exam" } ] }, { "parent_subject_name": "Arabic", "subject_name": "Khati", "exams": [ { "score": "50.00", "exam_name": "Sa3i 1 " }, { "score": "60.00", "exam_name": "sa3i 2" }, { "score": "95.00", "exam