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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:16:29+00:00 2026-06-16T06:16:29+00:00

Using the development branch of restkit (0.20), is there a way to perform mapping

  • 0

Using the development branch of restkit (0.20), is there a way to perform mapping on a JSON string into the core data object store?

I know in 0.10, the method described at the bottom of this page worked but how is this operation performed in restkit 0.20? Any guidance appreciated! Thanks!

id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:MIMEType];
id parsedData = [parser objectFromString:JSONString error:&error];

RKObjectMappingProvider* mappingProvider = [RKObjectManager sharedManager].mappingProvider;
RKObjectMapper* mapper = [RKObjectMapper mapperWithObject:parsedData mappingProvider:mappingProvider];
RKObjectMappingResult* result = [mapper performMapping];
  • 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-16T06:16:30+00:00Added an answer on June 16, 2026 at 6:16 am

    I installed RESTKit v0.20.0pre4 yesterday and had the same need for one particular case.

    Here is an example of the JSON String I want to map:

    {"info":"the sun is shining","detail":"in Bordeaux ~ 29 °C"}
    

    This is how I perform the mapping.

    - (InfoRESTMapped *)mapInfoFromJSONString:(NSString *) JSONString{
    
    NSString* MIMEType = @"application/json";
    NSError* error;
    
    NSData *data = [JSONString dataUsingEncoding:NSUTF8StringEncoding];
    id parsedData = [RKMIMETypeSerialization objectFromData:data MIMEType:MIMEType error:&error];
    if (parsedData == nil && error) {
        //deal with error
    }
    
    RKObjectMapping *infoMapping = [RKObjectMapping requestMapping];
    [infoMapping addAttributeMappingsFromDictionary:@{
     @"info": @"myInfo",
     @"detail": @"myDetail",
     }];
    
    
    InfoRESTMapped *infoMapped = [[InfoRESTMapped alloc] init];
    RKMappingOperation* mapper = [[RKMappingOperation alloc] initWithSourceObject:parsedData destinationObject:infoMapped mapping:infoMapping];
    [mapper performMapping:&error];
    
    return infoMapped;
    }
    

    These posts led me to the solution I have suggested:

    • https://github.com/RestKit/RestKit/issues/999

    • https://groups.google.com/d/topic/restkit/M1d7WwcFBDA/discussion

    I hope it helps. I guess some other will give better solutions when the final version will be released (with better documentation too…).

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

Sidebar

Related Questions

Is there some sort of C# directive to use when using a development machine
In our team we are using a development, staging and a master branch plus
Previously, using SVN, I would have a branch that was my development branch, which
Here's an odd problem I encountered using Subversion: when merging from a development branch
Using TFS, we have the following: A main baseline A development branch for each
A common scenario when using source control is to have a development branch along
I want to start development using qt-embedded on my embedded device project. Can you
I'm doing some development using JS unde Adobe AIR. What I want to do
I'm new to website development using Java but I've got started with Wicket and
I designed a report using Business Development Studio 2008 and my reporting server is

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.