restkit

RestKit, Core Data, Magical Record, Lots of data and Lagging UI

不羁的心 提交于 2019-12-12 01:54:51
问题 I got an app which stores data about restaurants. Their menu, schedule and so on. Theres ~200 restaurants in the DB by now. The app used to retrieve those places by a single shot, but it was taking too much time to load, so i decided to load the data one by one. On the start app asks the server for an array of place's ids, then get the data via API. I set completion blocks for RK's operations to background queues, but it didn't help. Scrolls are running not smoothy enough and sometimes the

RestKit. RKObjectManager and queing

对着背影说爱祢 提交于 2019-12-12 01:46:53
问题 I have 2 fairly simple question. I have 2 mapped requests sent i close succession to each other, called by MAIN thread. First request: [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"SomePathToServer"delegate:self] Second request: [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"SomeOTHERpathtoServer" delegate:self]; My question is: Are they automatically queued by the object manager? When i run them now the first request will trigger a rather large syncing

Using request specific HTTP headers with RestKit

强颜欢笑 提交于 2019-12-12 01:37:20
问题 I have to communicate with a REST API with a custom authorization scheme. It uses a authorization header witch I need to set based on the content of the request, so the server can check that I known the scheme. I would like to use RestKit and its powerful Core Data utilization but I found it difficult to find a neat way to set this header for every different request. There isn't a thing like a delegate on RKObjectManager that is called before every request. Maybe I missed something, could

RestKit 0.20 Post Array Json issues

只愿长相守 提交于 2019-12-11 19:17:15
问题 This is the json that I need to post to services. { "deviceToken":"asdfasdfasdf", "alarm": [ { "start" "8:30", "end": "9:30", "line": "156", "code": "xxxafsdfasdf", "station": "asdfa", "stationLeft": 5, "available": true, "times": 2 }] } The response data just have one more field "id" in alarm: { "deviceToken":"asdfasdfasdf", "alarm": [ { "id":1, "start" "8:30", "end": "9:30", "line": "156", "code": "xxxafsdfasdf", "station": "asdfa", "stationLeft": 5, "available": true, "times": 2 }] } Then

RESTKIT + COREDATA = FetchResultsController issue

独自空忆成欢 提交于 2019-12-11 19:07:13
问题 Hi I have a problem with NSFetchedResultsController which is populated by data from the web application. To map tables from the server side I'm using RestKit framework . When I'm changing the current user the data inside my UITableViewController still present cells from the previous user but without information received from the server - just default label text values. However the number of cells is the same as the previous user. It happens to me only in one UITableViewController in others

Posting JSON array of strings with RestKit

喜夏-厌秋 提交于 2019-12-11 18:35:15
问题 I have the following object @interface MyObject : NSObject @property(nonatomic, copy) NSNumber *objectId; @property(nonatomic, copy) NSArray *tags; // array of strings, e.g. @[@"one", @"two"] @end I would like to POST a request using RestKit (version 0.23) to URL <base_url>/do_something/:objectId The request body should be just a JSON array of strings according to the tags property, i.e. ["one", "two"] I have a route defined. RKRoute *route = [RKRoute routeWithClass: [MyObject class]

RestKit: Intersect database seeding or where is didSeedObject in RestKit > 0.20?

ぃ、小莉子 提交于 2019-12-11 18:34:40
问题 I am updating a function to seed a database with a RestKit version < 0.10. There is a didSeedObject method to intersect the seeding. In my code it is used to map a relationship by primary / foreign key. In RestKit > 0.20 the seeding code has changed. There is now a RKManagedObjectImporter to do this. My question is: How can I intersect the seeding so I can create the relationship in the same kind of way it was done with didSeedObject ? EDIT : Since didSeedObject or a way to intersect the

Restkit + Coredata - NSFetchedResultsControllerDelegate callbacks not triggered for UPDATE operations alone

风格不统一 提交于 2019-12-11 18:32:45
问题 I have a strange problem here. I am not getting the callbacks for "Update" operations on my NSManagedObject, but where as any objects inserted into or removed from the collection of that entity type would trigger the delegate callbacks. Before I proceed with the question further, I would like to inform about my setup: NSFetchedResultsController is properly configured. Made sure that the property which is being modified externally is not any of the sort keys for the fetchedResultsController as

Restkit + Objective-c - Multiple calls to same web service

a 夏天 提交于 2019-12-11 16:33:36
问题 I'm new to restkit and iOS. I'm using xcode 4.2 and RestKit 0.2. I've been developing an iPhone app that communicates with some REST web services that I've created and now I'm facing a problem. A few of my web services are meant to be call more than once. The first request runs with no problem but when I try to make the call again, I get this error: 'NSInternalInconsistencyException', reason: 'Cannot add a request descriptor for the same object class as an existing request descriptor.' I do

RestKit GET Request with queryParameter: no matching responseDescriptor

一笑奈何 提交于 2019-12-11 13:43:36
问题 I'm trying to do a request with Restkit, but I get the following Error: {Error Domain=org.restkit.RestKit.ErrorDomain Code=1001 "No mappable object representations were found at the key paths searched." UserInfo={NSLocalizedDescription=No mappable object representations were found at the key paths searched., NSLocalizedFailureReason=The mapping operation was unable to find any nested object representations at the key paths searched: This likely indicates that you have misconfigured the key