Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8676041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:05:28+00:00 2026-06-12T20:05:28+00:00

My JSON has the following structure: { <Person>k__BackingField = { _email = name@domain.com; _emailUpdate

  • 0

My JSON has the following structure:

{
"<Person>k__BackingField" =     {
    "_email" = "name@domain.com";
    "_emailUpdate" = 1;
    "_firstName" = "First";
    "_lastName" = "Last";
};
"<SharedKey>k__BackingField" = "some-long-random-string";
}

I’m using restkit to login as this person. It creates the Post, and gets that response correctly. My mappings are set up like this:

+(void)ConfigureAPI
{
[super ConfigureAPI];
// Initialize RestKit
[RKObjectManager managerWithBaseURLString: @"www.api_root.com/";
Class<RKParser> parser = [[RKParserRegistry sharedRegistry] parserClassForMIMEType:@"application/json"];
[[RKParserRegistry sharedRegistry] setParserClass:parser forMIMEType:@"text/plain"];

RKObjectMapping *mapping;

// Person
mapping = [RKObjectMapping mappingForClass:[Person class]];
[mapping mapKeyPath:@"_email" toAttribute:@"email"];
[mapping mapKeyPath:@"_emailUpdate" toAttribute:@"emailUpdate"];
[mapping mapKeyPath:@"_firstName" toAttribute:@"firstName"];
[mapping mapKeyPath:@"_lastName" toAttribute:@"lastName"];
[[RKObjectManager sharedManager].mappingProvider setMapping:mapping forKeyPath:@"<Person>k__BackingField"];
}

When I run the application and call the function that gets the JSON response, I get the following error:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFString 0x7b41800> valueForUndefinedKey:]: this class is not key value coding-compliant for the key <Person>k__BackingField.'

Anybody know why I’m getting this? everything seems to be set up correctly

EDIT

In case it helps, this is how I’m handling the response:

    // when you get the response...
    request.onDidLoadResponse = ^(RKResponse *response){
        RKObjectMapper *mapper = [RKObjectMapper mapperWithObject:[response bodyAsString] mappingProvider:[RKObjectManager sharedManager].mappingProvider];

        Person *person = nil;
        RKObjectMappingResult *mappingResult = [mapper performMapping];
        person = [mappingResult asObject];
    };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:05:28+00:00Added an answer on June 12, 2026 at 8:05 pm

    You are not converting the response string into a JSON object before passing it to the RKObjectMapper. You were passing in the string value of the response which does not respond to valueForKey: which explains the exception you were getting. You can easily convert it into an object like this:

    request.onDidLoadResponse = ^(RKResponse *response){
    
        NSError *error;
        id jsonObject = [response parsedBody:&error];
    
        if(error)
            NSLog(@"Error parsing JSON: %@", error.localizedDescription);
        else {
            RKObjectMapper *mapper = [RKObjectMapper mapperWithObject:jsonObject mappingProvider:[RKObjectManager sharedManager].mappingProvider];
    
            Person *person = nil;
            RKObjectMappingResult *mappingResult = [mapper performMapping];
            person = [mappingResult asObject];
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an html form that has the following structure: <input type=text name=title />
Google Web Toolkit has a JSON library (com.google.gwt.json.client). The 'client' part of that name
I have parsed a json object that has the following structure: { data =
I have a JSON request which has follwing structure: formats: { flash_embed: http://a3.vikiassets.com/assets/vikiplayer-922746a667cfd38137a7e45df6ba1b95.swf?auto_play=true&language_codes=en&media_id=74965&partner=16&source=api_v3, m3u8:
I have a JSON file that has more name value pairs than I care
I've got the following JSON structure that defines a table and it's data. var
I have seen a tutorial that has the following JSON: { books:[{title:frankenstein},{title:Moby Dick}] }
In some JSON I am working with, it has the following: value: [[field1, field2]]
I have a file data.json . It has following data [ 101 200, 102
I have a json structure that looks something like this: list:[ { type:link, href:http://google.com

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.