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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:57:28+00:00 2026-06-01T03:57:28+00:00

Thanks to the help here and on the RestKit mailing list I’ve been able

  • 0

Thanks to the help here and on the RestKit mailing list I’ve been able to parse my JSON, but now I have a new problem, parsing an empty response. To set the stage, here’s what the JSON looks like when my query has results:

    {"blobsList":
        {"blobs":
            [   
                {"createdOn":"2012-03-16T15:13:12.551Z","description":"Fake description ","hint":"And a useless hint","id":400,"name":"Fake CA one","publicId":"FF6","type":0},

                {"createdOn":"2012-03-16T17:33:48.514Z","description":"No hint on this one, but it does have a description.","hint":"Hint","id":402,"name":"Second fake one in CA","publicId":"FF8","type":0}
            ]}}

So I added this to my mapping:

        RKObjectMapping* blobsListMapping = [RKObjectMapping mappingForClass:[GetResponseInRegionResponseList class]];
        [blobsListMapping mapKeyPath:@"blobsList" toAttribute:@"blobsList"];

        [[RKObjectManager sharedManager].mappingProvider setMapping:blobMapping forKeyPath:@"blobsList.blobs"];

        [[RKObjectManager sharedManager].mappingProvider setMapping:blobsListMapping forKeyPath:@"blobsList"];

And are are my Classes:

        @interface GetResponseInRegionResponse : NSObject
        {
            NSString* name;
            NSString* blobId;
            NSString* description;
            NSString* hint;
        }


        @interface GetResponseInRegionResponseList : NSObject
        {
            NSArray  *blobsList;
        }

But now the wrinkle is that my server can also return this for JSON:

        {"blobsList":""} 

Yeah, if the query has no results I get that back. It crashes my app

        restkit.object_mapping:RKObjectMapper.m:255 Performing object mapping sourceObject: {
            blobsList = "";
        }
         and targetObject: (null)

        2012-03-22 11:56:16.233 Ferret[7399:17a07] T restkit.object_mapping:RKObjectMapper.m:269 Examining keyPath 'blobs' for mappable content...
        2012-03-22 11:56:16.233 Ferret[7399:17a07] D restkit.object_mapping:RKObjectMapper.m:279 Found unmappable value at keyPath: blobs
        2012-03-22 11:56:16.233 Ferret[7399:17a07] T restkit.object_mapping:RKObjectMapper.m:269 Examining keyPath 'blobsList.blobs' for mappable content...
        2012-03-22 11:56:16.239 Ferret[7399:17a07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFConstantString 0xdb1d0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key blobs.'

So I’m trying to come up with a way to get ResKit to map this empty response. I’ve tried all of these:

[[RKObjectManager sharedManager].mappingProvider setMapping:blobListMapping forKeyPath:@"blobsList"];
[[RKObjectManager sharedManager].mappingProvider setMapping:NULL forKeyPath:@"blobsList"];
[blobListMapping mapKeyPath:@"" toAttribute:@"blobsList"];
[blobListMapping mapKeyPath:@"blobsList" toAttribute:@"blobsList"];

But they all crash. I’m trying to make heads and tails of the source, the “this class is not key value coding-compliant for the key blobs” is puzzling since there aren’t any blobs there, just blobsList. I appreciate any help, thanks!

  • 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-01T03:57:29+00:00Added an answer on June 1, 2026 at 3:57 am

    I ran into something similar in my project. I was posting to a web service and that service was returning to me my posted object wrapped in an array. This caused RestKit to crash when parsing because it expected to only get a single object back and not a collection. To fix the problem I implemented the objectLoader:willMapData: delegate method and pulled the response object out of the array and sent that object through the RestKit parsing and all is well.

    Maybe you can do something similar. Check to see if you get back a string in blobslist and convert that to an empty array before sending it through the RestKit parsing.

    - (void)objectLoader:(RKObjectLoader *)objectLoader willMapData:(id *)mappableData
    {
        // Horrible hack to convert posted object that gets returned as an array into a single object
        // that can be mapped.
        //
        if ([objectLoader.targetObject isKindOfClass:[TSLPostPostContract class]])
        {
            if ([*mappableData isKindOfClass:[NSArray class]])
            {
                *mappableData = [*mappableData objectAtIndex:0];
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a show/hide toggle working well in multiple instances (thanks to help here
I need help here in my practice program. I have a json array: myData=[{plank_number:1,thickness:5,width:7,length_t:8,quantity:1},
I currently have this code (thanks for the help from here). I need to
Is anyone able to help here? I have an image map formed of a
Thanks to pbos help and its program (published here , for xoring a big
Thanks for your help! I'd like to output all companyName entries that have uploads
Thanks in advance for your help experts. I want to be able to copy
Thanks for the help here: foreach loops & stdclass objects I set up a
Hi Folks thanks for your help here. I am trying to create a rails
I've already got help here for creating a quotation extraction function. Thanks alot, soulmerge!

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.