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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:43:15+00:00 2026-05-23T16:43:15+00:00

Im using Restkit OM2 to take in a json and map to objects on

  • 0

Im using Restkit OM2 to take in a json and map to objects on iphone.
Im currently confused on how to structure the mappings and could do with some help.

Below is an example json file

    {
    -magic_verbs: [
    -{
    lemma: "work"
    position: 5
    score: "0.75"
    value: "working"
    }
    -{
    lemma: "head"
    position: 0
    score: "0.75"
    value: "heading"
    }
],
magic_advs: [
-{
lemma: "not"
position: 2
score: "0.6"
value: "not"
}
-{
lemma: "just"
position: 2
score: "0.6"
value: "just"
}
]
}

i only need the lemma and value fields from each of these. so for example the verb class contains

@interface Verbs : NSManagedObject {

}
@property (nonatomic,retain) NSString *lemma;
@property (nonatomic,retain) NSString *value;

@end

@implementation Verbs

@synthesize lemma,value;

@end

then i read in the json and create the mappings with below code

objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://localhost:3000"];
        objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"RKRelationshipMappingExample.sqlite"];

        [RKObjectManager setSharedManager:objectManager];

        RKObjectMappingProvider* provider = [[RKObjectMappingProvider new] autorelease];

        RKObjectMapping* verbMapping = [RKObjectMapping mappingForClass:[Verbs class]];
        [verbMapping mapKeyPath:@"lemma" toAttribute:@"lemma"];
        [verbMapping mapKeyPath:@"value" toAttribute:@"value"];
        [provider setMapping:verbMapping forKeyPath:@"magic_verbs"];
 [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/api/users/1/magic_words" objectMapping:verbMapping delegate:self];

I have done the same for the adjs mapping. I also have a class called words that contains 2 nsarrays that is to contain the object mapping data. but im unsure how to implement this and link them up correctly.

@interface Words : NSObject {

    NSArray *_verbs;
    NSArray *_adjs;
}

@property (nonatomic, retain) NSArray *verbs,*adjs;
@end

any help and guidance on this is appreciated. I have looked at the example in catalog project and have been able to get that running but havent been able to master the concept to apply it to my own json files.

thanks

G

  • 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-23T16:43:16+00:00Added an answer on May 23, 2026 at 4:43 pm

    I suggest you to look at the new documentation of OM 2.0 that is in the Github page here
    if you haven’t noticed yet. It clearly lays out on how to map your JSON to an object.

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

Sidebar

Related Questions

i am using coredata and restkit to map data. here is the json response
I am having trouble mapping a JSON response to objects using RestKit and Objective-C.
I am using RESTKIT to map the JSON returned from server. The JSON result
I'm using RestKit for HTTP requests, and with some request, I get JSON response
I'm using RestKit to grab objects from my RoR service and using CoreData to
I am using RestKit, GData and Facebook API. All of them has a JSON
I need to send a JSON request to a REST service. I'm using Restkit
I am trying to dynamically map JSON information into different objects. But I can't
I'm using the RestKit library to load json from my REST services, and then
I am using the great RestKit Framework for an iPhone Application. I have got

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.