restkit

RestKit CoreData 0.20.3 - additional check before saving the MOC after mapping finished

早过忘川 提交于 2019-12-11 01:21:08
问题 Is it any way to to add additional check to entity mapping? I have a returned object from the server with the same identification attribute and I need to check if last modified date is newer then my object stored in my local store. By default RestKit will overwrite my local instance if the identification attribute is the same. The mapping is done on a child context and I am trying to compare the new value from the server before the child context is saved back to parent but I can't find any

Reskit object mapping returns model objects with nil attributes

旧巷老猫 提交于 2019-12-10 22:35:25
问题 I'm trying to map the items of the RSS feeds. The RKObjectRequestOperation returns the exact number of objects but the attributes values are nil. Following is my code NSURL *requestURL = [NSURL URLWithString:@"http://sports.espn.go.com/espn/rss/nfl/news"]; [RKMIMETypeSerialization registerClass:[RKXMLReaderSerialization class] forMIMEType:@"application/rss+xml"]; RKObjectMapping *rssFeedObjectMapping = [RKObjectMapping mappingForClass:[SBRssFeed class]]; [rssFeedObjectMapping

RestKit : Not able to perform mapping using coredata

杀马特。学长 韩版系。学妹 提交于 2019-12-10 22:05:29
问题 I'm using rest kit 0.20.3 and Xcode 5. Without core data I'm able to perform all rest kit operation, but when I've tried it with core data, I'm not even able to perform GET due to some problem. I can't figure it out. I'm new with core data. So pls help. Here is my code: AppDelegate.m @implementation CardGameAppDelegate @synthesize managedObjectContext = _managedObjectContext; @synthesize managedObjectModel = _managedObjectModel; @synthesize persistentStoreCoordinator =

RestKit valueTransformer not being called

流过昼夜 提交于 2019-12-10 20:03:54
问题 I am using RestKit to talk to my JSON endpoints. The endpoint returns a UNIX timestamp in 'number of milliseconds'. But RestKit's default transformer assumes that it is 'number of seconds' and I get a wrong value in NSDate. So I looked around, and found that I need to use a custom valueTransformer to tell RestKit how to transform my timestamp. Here's the code I have. + (RKBlockValueTransformer*) timeIntervalInMillisecondsSince1970TwoWayTransformer { return [RKBlockValueTransformer

Seeking recommendations for best RestKit/CoreData mapping and JSON structure for shallow routes

孤人 提交于 2019-12-10 18:55:29
问题 I'm developing a CoreData iOS app that's backed by a (Rails) REST API (that supports shallow routes). Because there are a lot of objects in the graph, I'd like the REST GETs to not to include a lot of nested results and, instead, just contain references that RestKit uses to establish (faulted) relationships. I'll then use shallow routes to request the individual (or groups of) objects as needed. Assuming I have a one-to-many (<-->>) data model such as A <-->> B, I have: RKEntityMapping *a

Using RestKit, use block to load object, when and how to cancel the request?

陌路散爱 提交于 2019-12-10 18:45:15
问题 [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"app/site_pattern" usingBlock:^(RKObjectLoader* loader) { [loader setObjectMapping:clientMappring]; loader.delegate = self; shopLoader = loader; }]; Above, I use the block function to load some data in my app, but when I pop this viewcontroller, I don't know when and how to cancel this request . Any idea? - (void)showSelectShop { SelectShopViewController * selectShopViewController = [[SelectShopViewController alloc] initWithNibName:@

Restkit has suddenly stopped compiling today

时间秒杀一切 提交于 2019-12-10 18:23:52
问题 I am using RestKit in my project since a long time, using CocoaPods. Podfile:pod 'RestKit', '~> 0.26.0' Today, for unknown reasons, my project doesn't compile anymore. To the best of my knowledge, i have not changed any project settings or anything. I get the error in RKObjectManager.h: /projects/iphone/Pods/Headers/Public/RestKit/Network/RKObjectManager.h:892:49: Unknown type name 'AFNetworkReachabilityStatus'; did you mean 'SCNetworkReachabilityFlags'? If i go into the h.file and click on

RestKit Makes UI Unresponsive

*爱你&永不变心* 提交于 2019-12-10 18:18:47
问题 I'm using RestKit version 0.2 and I'm seeing it block the UI (meaning, the UI becomes choppy/unresponsive) when I call RKRequestOperation as follows: - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { NSString *urlString = [NSString stringWithFormat:@"http://localhost:8080/models?offset=%d&rows=%d", _offset, _numRows]; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *request =

RestKit does not map BOOL in 64 bit simulator

旧街凉风 提交于 2019-12-10 17:13:15
问题 I need help understanding the error below. I have a BOOL in my NSObject defined as: @property (nonatomic) BOOL isOpen; In my reskit class I use: [mapping addAttributeMappingsFromDictionary:@{...... @"isOpen": @"isOpen" ......}]; Has worked perfectly for weeks for all my tests using my iPhone4S and an original iPhone5. As a last test I tested on the simulator on a 64 bit device and I get the following error: restkit.object_mapping:RKMappingOperation.m:440 Failed transformation of value at

RestKit: how to fetch a simple JSON array of strings?

久未见 提交于 2019-12-10 16:27:38
问题 How should I use RestKit to fetch a JSON array of strings like this : ["Paris", "London", "Brussels", "New York"] I tried to make an object mapping but since there's no key path or attribute, I don't know what to map. I don't even need a mapping, the result could just be an array or a dictionary. Is there a way to achieve that? EDIT: For more info & solution : https://github.com/RestKit/RestKit/issues/1290 回答1: You need to create a mapping with a nil keypath. This instructs RestKit to