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

  • Home
  • SEARCH
  • 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 6038543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:14:13+00:00 2026-05-23T06:14:13+00:00

Hi stackoverflow community, i’m using RKObjectManager to make iOS RESTful requests to map responses

  • 0

Hi stackoverflow community,
i’m using RKObjectManager to make iOS RESTful requests to map responses to local objects.

My problem with Restkit, is to register multiple classes for the same Element in different requests. In this requests i have nested objects with the same element name “List”.

Here is part of the code:

// Get array of RKObjects1 - First request of the queue
RKObjectManager * objectManager = [RKObjectManager sharedManager];
[objectManager registerClass:[RKTObject1 class] forElementNamed:@"List"];

RKObjectLoader * loader = [objectManager objectLoaderWithResourcePath:@"objects1" delegate:self];
[loader setObjectClass:[RKTList class]];



// Get array of RKObjects2 - Second request of the queue
RKObjectManager * objectManager = [RKObjectManager sharedManager];
[objectManager registerClass:[RKObjects2 class] forElementNamed:@"List"];

RKObjectLoader * loader = [objectManager objectLoaderWithResourcePath:@"objects2" delegate:self];
[loader setObjectClass:[RKTList class]];

What i would like to know, if there is any solution to register multiple classes for the same element in different requests?

  • 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-05-23T06:14:14+00:00Added an answer on May 23, 2026 at 6:14 am

    Well, to solve my problem, i update restkit and with the new Object Mapping 2.0 it’s possible to register multiple classes for the same element keys.

    You only need to create different RKObjectMapping objects for each request and make setObjectMapping of each object in RKObjectLoader.

    For example:

    RKObjectMappingProvider * mappingProvider = [RKObjectManager sharedManager].mappingProvider; 
    
    // Create 2 RKObjectMapping for each request
    RKObjectMapping * object1Mapping = [RKObjectMapping mappingForClass:[RKTList class]];
    [object1Mapping mapKeyPath:@"Id" toAttribute:@"idObject"];
    [object1Mapping mapKeyPath:@"Name" toAttribute:@"name"];
    [mappingProvider setMapping:object1Mapping forKeyPath:@"Objects1List"];
    
    
    RKObjectMapping * object2Mapping = [RKObjectMapping mappingForClass:[RKTList class]];
    [object2Mapping mapKeyPath:@"Id" toAttribute:@"idObject"];
    [object2Mapping mapKeyPath:@"Name" toAttribute:@"name"];
    [mappingProvider setMapping:object2Mapping forKeyPath:@"Objects2List"];
    
    //Make the 2 request with explicit object mapping
    RKObjectManager * objectManager = [RKObjectManager sharedManager];
    RKObjectLoader * loaderFirstRequest = [objectManager objectLoaderWithResourcePath:@"objects1" delegate:self];
    [loaderFirstRequest setObjectMapping:object1Mapping];
    
    RKObjectLoader * loaderSecondRequest = [objectManager objectLoaderWithResourcePath:@"objects2" delegate:self];
    [loaderSecondRequest setObjectMapping:object2Mapping];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello StackOverflow community, Using Google App Engine, I wrote a keyToSha256() method within a
Dear members of the Stackoverflow community, We are developing a web application using the
Hey stackoverflow community! I'm having an issue where a highly involved algorithmic program is
Want to know what the stackoverflow community feels about the various free and non-free
Hello stackoverflow community ! I am trying to figure out how to architect my
Hello StackOverflow community, The air.swf file referenced here: http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html used to launch AIR applications
Hello StackOverflow community, Is there any way to open a folder in Windows Explorer
Hello StackOverflow community, Is there any way to package the installer for an Adobe
With the help of the stackoverflow community, I've got the dragging to work perfectly
Thought I would ask the knowledgeable StackOverflow community a question that was on my

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.