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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:48:56+00:00 2026-06-08T08:48:56+00:00

I’m trying to use the object loader to fetch objects from an API with

  • 0

I’m trying to use the object loader to fetch objects from an API with that needs to pass in a type as a query parameter (e.g. http://example.com/api/households/:householdId/checklist_items?kind=todo) but no matter which way I try registering the resource path it doesn’t seem to want to locate my mapping.

I’m setting up a mapping like this:

RKObjectMapping* mapping = [RKObjectMapping mappingForClass:[RMChecklistItem class]];
[mapping mapKeyPath:@"id" toAttribute:@"checklistItemId"];
[mapping mapKeyPath:@"kind" toAttribute:@"kind"];
[mapping mapKeyPath:@"title" toAttribute:@"title"];
[mapping mapKeyPath:@"completed" toAttribute:@"completed"];
[mapping mapKeyPath:@"abilities" toAttribute:@"abilities"];
[mapping mapKeyPath:@"comments" toRelationship:@"comments" 
        withMapping:[provider objectMappingForClass:[RMComment class]]];

And registering it with the object mapping provider using the base path and a version with the query string:

[provider addObjectMapping:mapping];
[provider setObjectMapping:mapping forResourcePathPattern:@"/api/households/:householdId/checklist_items"];
[provider setObjectMapping:mapping forResourcePathPattern:@"/api/households/:householdId/checklist_items?kind=:kind"];

But when I try to use it:

NSDictionary *params [NSDictionary dictionaryWithObject:@"todo" forKey:@"kind"];
NSString *path = [NSString stringWithFormat:@"/api/households/%i/checklist_items", householdId.intValue];
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:[path stringByAppendingQueryParameters:params] usingBlock:^(RKObjectLoader *loader) {
    loader.onDidLoadObjects = ^(NSArray *objects) {
        NSLog(@"%@", objects);
    };
    loader.onDidFailWithError = ^(NSError *error) {
        NSLog(@"%@", error);
    };
    loader.onDidFailLoadWithError = ^(NSError *error) {
        NSLog(@"%@", error);
    };
}];

It goes badly:

2012-07-20 12:13:18.533 roommates[22399:13d03] D restkit.object_mapping:RKObjectMapper.m:336 Performing object mapping sourceObject: (
        {
        abilities =         {
            destroy = 1;
        };
        comments =         (
        );
        completed = 0;
        id = 44;
        kind = todo;
        title = "and do the dishes";
    },
        {
        abilities =         {
            destroy = 1;
        };
        comments =         (
                        {
                body = "your!";
                "created_at" = "2012-07-18T22:20:08-05:00";
                "creator_id" = 16;
                id = 70;
            }
        );
        completed = 0;
        id = 43;
        kind = todo;
        title = "pick you shit up";
    },
        {
        abilities =         {
            destroy = 1;
        };
        comments =         (
                        {
                body = "did it";
                "created_at" = "2012-07-18T22:19:56-05:00";
                "creator_id" = 16;
                id = 69;
            }
        );
        completed = 0;
        id = 40;
        kind = todo;
        title = "Pay Rent";
    }
)
 and targetObject: (null)
2012-07-20 12:13:18.539 roommates[22399:13d03] T restkit.object_mapping:RKObjectMapper.m:293 Examining keyPath 'users' for mappable content...
2012-07-20 12:13:18.539 roommates[22399:13d03] D restkit.object_mapping:RKObjectMapper.m:120 Found a collection containing only NSNull values, considering the collection unmappable...
2012-07-20 12:27:47.702 roommates[22399:13d03] D restkit.object_mapping:RKObjectMapper.m:303 Found unmappable value at keyPath: users
2012-07-20 12:27:47.705 roommates[22399:13d03] D restkit.object_mapping:RKObjectMapper.m:367 The following operations are in the queue: (
)
2012-07-20 12:27:51.065 roommates[22399:13d03] W restkit.object_mapping:RKObjectMapper.m:87 Adding mapping error: Could not find an object mapping for keyPath: ''
2012-07-20 12:27:51.066 roommates[22399:13d03] E restkit.network:RKObjectLoader.m:234 Encountered errors during mapping: Could not find an object mapping for keyPath: ''
  • 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-08T08:48:57+00:00Added an answer on June 8, 2026 at 8:48 am

    So watching the flow in the debugger I came across RKObjectMappingProvider’s mappingForPatternMatchingString:context: which calls RKPathMatcher’s matchesPath:string tokenizeQueryStrings:NO parsedArguments:nil so I guess this is by design.

    I’ve really only got two possible values for the query parameter ‘todo’ and ‘shopping’ so it wasn’t unreasonable to register both both.

    Update: I submitted a pull request that changes this to parse tokens in query strings: https://github.com/RestKit/RestKit/pull/871

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.