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 8124775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:34:33+00:00 2026-06-06T06:34:33+00:00

I have some troubles mapping a JSON Array to RestKit. This is what the

  • 0

I have some troubles mapping a JSON Array to RestKit. This is what the JSON File looks like:

{"issuelist":[
    {
        "issue":[
            {
                "id":1,
                "beschreibung":"",
                "name":"Test1"
            },
            {
                "id":2,
                "beschreibung":"",
                "name":"Test2"
            }
        ]
    }
]}

I am interested in the “issue”s array. This is my mapping for a single issue:

RKObjectMapping *objectMapping = [RKObjectMapping mappingForClass:[self class] usingBlock:^(RKObjectMapping *mapping) {
        [mapping mapAttributes:@"name", @"beschreibung", nil];
        [mapping mapKeyPathsToAttributes:
                @"id", @"identifier",
                nil];
    }];

And here is how I setup my ObjectMapping

RKObjectMappingProvider *omp = [RKObjectManager sharedManager].mappingProvider;

RKObjectMapping *issueMapping = [Issue mapping];
[omp addObjectMapping:issueMapping];

[omp setObjectMapping:issueMapping forKeyPath:@"issuelist.issue"];

Unfortunately this doesn’t work. I get an log output like this:


    T restkit.object_mapping:RKObjectMappingOperation.m:152 Found transformable value at keyPath 'name'. Transforming from type '__NSArrayI' to 'NSString'
    W restkit.object_mapping:RKObjectMappingOperation.m:232 Failed transformation of value at keyPath 'name'. No strategy for transforming from '__NSArrayI' to 'NSString'
    T restkit.object_mapping:RKObjectMappingOperation.m:339 Skipped mapping of attribute value from keyPath 'name to keyPath 'name' -- value is unchanged ((null))
    T restkit.object_mapping:RKObjectMappingOperation.m:322 Mapping attribute value keyPath 'beschreibung' to 'beschreibung'
    T restkit.object_mapping:RKObjectMappingOperation.m:152 Found transformable value at keyPath 'beschreibung'. Transforming from type '__NSArrayI' to 'NSString'
    W restkit.object_mapping:RKObjectMappingOperation.m:232 Failed transformation of value at keyPath 'beschreibung'. No strategy for transforming from '__NSArrayI' to 'NSString'
    T restkit.object_mapping:RKObjectMappingOperation.m:339 Skipped mapping of attribute value from keyPath 'beschreibung to keyPath 'beschreibung' -- value is unchanged ((null))
    T restkit.object_mapping:RKObjectMappingOperation.m:322 Mapping attribute value keyPath 'id' to 'identifier'
    T restkit.object_mapping:RKObjectMappingOperation.m:152 Found transformable value at keyPath 'id'. Transforming from type '__NSArrayI' to 'NSString'
    W restkit.object_mapping:RKObjectMappingOperation.m:232 Failed transformation of value at keyPath 'id'. No strategy for transforming from '__NSArrayI' to 'NSString'
    T restkit.object_mapping:RKObjectMappingOperation.m:339 Skipped mapping of attribute value from keyPath 'id to keyPath 'identifier' -- value is unchanged ((null))
    D restkit.object_mapping:RKObjectMappingOperation.m:624 Finished mapping operation successfully...

It seems as if RestKit is trying to map the whole arry in one Issue instead of creating an array of Issues.
How do I need to change my mapping to correct this?

Thanks for your help!

  • 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-06T06:34:35+00:00Added an answer on June 6, 2026 at 6:34 am

    Try this:

    RKObjectMapping* issueMapping = [RKObjectMapping mappingForClass: [Issue class] usingBlock:^(RKObjectMapping *mapping) {
        [mapping mapAttributes:@"name", @"beschreibung", nil];
        [mapping mapKeyPathsToAttributes:
         @"id", @"identifier",
         nil];
    }];
    issueMapping.rootKeyPath = @"issue";
    [omp setObjectMaping: issueMapping forKeyPath: @"issuelist"];
    

    This says, when issuelist keypath is encountered use the issueMapping. And then it says for every root issue, create an Issue object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some HTML that looks like this: <ul class=faq> <li class=open> <a class=question
I have some troubles with positioning my label/password field. With this code they both
I have some troubles while writing logs from log4net to the file. I seem
I have some troubles with an array. I have one array that I want
I have some troubles with the application of polymorphism in this example. This question
I have some troubles with plotting the figure. I have a file with some
I have some troubles re-writing this query to using joins instead of the two
I have some troubles with receiving data on server side. Here goes the code:
Right now I have some troubles. I'm finding a way to solve one problem.
I'm trying to start my java game but I have some troubles with the

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.