restkit

The entity (null) is not key value coding-compliant for the key “title”

痞子三分冷 提交于 2019-12-10 15:09:59
问题 I'm trying to get RestKit and CoreData to work together. I'm getting closer, but I'm getting the following error: CoreData: error: Failed to call designated initializer on NSManagedObject class 'Book' *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Book 0x8454560> valueForUndefinedKey:]: the entity (null) is not key value coding-compliant for the key "title".' It seems to me that it's finding my Book class successfully, and it DOES have a title property. What

Why does RKNSJSONSerialization crash on iOS 6?

五迷三道 提交于 2019-12-10 14:18:17
问题 I'm seeing a crash in RKNSJSONSerialization on iOS 6 only - not on iOS 7. I'm using RestKit 0.20.3 and it happens fairly consistently for me. Even when I make the same request and get the same response for iOS 6/7, it works fine on iOS 7 but crashes on iOS 6. Here's the crash - it's an EXC_BAD_ACCESS: http://crashes.to/s/2610b639062 The relevant (crashing) line in RestKit's RKNSJSONSerialization is the return: + (id)objectFromData:(NSData *)data error:(NSError **)error { return

Objective-C category is not loaded - How to debug this

冷暖自知 提交于 2019-12-10 13:17:04
问题 I have two projects which the RestKit framework. One project works without problems but another project fails, as soon as the RestKit framework is used. I found out that the failing code is this: return [anNSString MD5]; The MD5 method is a category method and is imported like this: #import "NSString+MD5.h" However, in one project, I keep getting the following error: -[__NSCFString MD5]: unrecognized selector sent to instance 0x88a3390 I understand the basics of categories, and that they can

Target Integrity - The file “Pods-ios.xcconfig” couldn't be opened because its path couldn't be resolved. It may be missing"

我是研究僧i 提交于 2019-12-10 12:57:15
问题 I'm trying to utilize the four Examples that ship with RestKit Version 0.20.1 Currently trying to Build RKSearchExample. The Build "succeeds" but no simulator appears and I get two warnings 1st one - Target Intergrity - The file "Pods-ios.xcconfig" couldn't be opened because there is no such file. .... 2nd one - Target Integrity - The file "Pods-ios.xcconfig" couldn't be opened because its path couldn't be resolved. It may be missing" I assume that this file is missing and even though the

iOS and RestKit: How to get a text/html response right?

[亡魂溺海] 提交于 2019-12-10 11:39:13
问题 I have tried several StackOverflow questions, and I caanot find the correct answer on this. I am using the POSTMAN plugin for Chrome to check my REST calls and I cannot figure out why I cannot read the response. In the comments you will see all the different attempts I have made to get the response. NSDictionary* session_params = @{SESSION_USERNAME_KEY:SESSION_USERNAME_VALUE, SESSION_PASSWORD_KEY:SESSION_PASSWORD_VALUE}; NSURL* url = [NSURL URLWithString:SESSION_URL]; RKObjectManager*

RESTKit: Comparing GET object with locally persisted before overwriting

﹥>﹥吖頭↗ 提交于 2019-12-10 10:34:20
问题 I have a saved object (persisted) in Core Data. Lets say below are the values: //Entity: employee objectID: 1111 firstName: @"Jon" lastName: @"D" modified: @"10:45PM" Now, I do a RKManagedObjectRequestOperation *operation request. I set operation.savesToPersistentStore = NO; and start the operation. The object was downloaded and it's been modified to the following: //Entity: employee objectID: 1111 firstName: @"Jonathan" lastName: @"Doe" modified: @"10:55PM" //I have 15 other properties that

RestKit - Map keypath of an array to the object inside of that array

六眼飞鱼酱① 提交于 2019-12-10 09:23:59
问题 I really stack up parsing this particular response with RestKit 0.20: "addons": [ { "id": 1, "name": "Addon one", "version": 2 }, { "id": 2, "name": "Addon two", "version": 3 } ], "forms": [ { "id": 1, "name": "Form one", "version": 1 } ] The problem is that I need to translate the response to an array of object of the same class, such as @interface MyCoreDataObject : NSManagedObject @property (nonatomic, retain) NSString * uid; @property (nonatomic, retain) NSNumber * version; @property

How do I create/post a new managed object to server using Restkit 0.20.0?

雨燕双飞 提交于 2019-12-10 05:48:10
问题 I'm having a very hard time finding documentation or examples of creating a new managed object, setting it's values, and saving to the server using Restkit. I have a NSManagedObject Post: @interface Post : NSManagedObject @property (nonatomic, retain) NSNumber * postID; @property (nonatomic, retain) NSString * title; @property (nonatomic, retain) NSString * text; @end This is my AppDelegate Setup: // ---- BEGIN RestKit setup ----- RKLogConfigureByName("RestKit/Network", RKLogLevelTrace);

Restkit, disable caching

蓝咒 提交于 2019-12-10 04:48:11
问题 I've got a really hard time to try disabling caching in the Restkit framework. I've try to put the cache policy to none, with no effect at all. What's the correct way to do this? 回答1: So once you've got a client, either explicitly initializing it: RKClient *client = [RKClient clientWithBaseURL:url]; or by letting the object manager do it: RKObjectManager* om = [RKObjectManager managerWithBaseURLString:url]; RKClient *client = om.client; It should be a simple matter of just setting the cache

Can I use RestKit and Realm.io?

心已入冬 提交于 2019-12-10 03:34:35
问题 I want to use RestKit, but I already use Realm.io instead of CoreData. Is it possible to use RestKit on top of Realm.io? 回答1: Sure you can. Once you get the object back from RestKit: // GET a single Article from /articles/1234.json and map it into an object // JSON looks like {"article": {"title": "My Article", "author": "Blake", "body": "Very cool!!"}} RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[Article class]]; [mapping addAttributeMappingsFromArray:@[@"title", @"author", @