New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RKManagedObjectImporter crashes while importing when source attribute starts from symbol '@' #1204
Comments
This is a known limitation and a consequence of RestKit's reliance on Cocoa's key-value coding system for property access. The '@' prefix is reserved for denominating key-value collection operators. You are going to need to change that JSON format to effectively work with RestKit. Using |
Thank you. |
Hello, If I manually call the service and query the JSON object I get (ie:
) I can get those keys with no problems:
Since restKit is using AFN as well, I'm not getting why those keys are un-usable :( thx for help |
Maybe the solution will be to introduce some kind of flag or special prefix symbol or escaping. I really like the idea of collection operators support. |
It still supports those. |
Thanks. Then I'm looking forward to the new RestKit release with the improvement. |
RestKit version is (0.20.0pre6).
The following error received: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFDictionary 0x825cc20> valueForUndefinedKey:]: this class is not key value coding-compliant for the key project.'
Crash happens at the class RKMappingOperation in method applyAttributeMappings, code : id value = (attributeMapping.sourceKeyPath == nil) ? self.sourceObject : [self.sourceObject valueForKeyPath:attributeMapping.sourceKeyPath];
There are piece of my code:
[assignmentMapping addAttributeMappingsFromDictionary:@{@"@project": @"projectId"}];
Source attribute is '@project', which starts from the symbol '@'.
Possible solution is described there http://stackoverflow.com/questions/13294696/error-getting-valueforkey-in-an-nsdictionary-for-key-containing-character.
The text was updated successfully, but these errors were encountered: