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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:53:47+00:00 2026-06-12T06:53:47+00:00

This has probably been asked a million times, but I’m not getting anywhere from

  • 0

This has probably been asked a million times, but I’m not getting anywhere from all the examples that I’m finding.

I have the following class:

@interface LoginRequest : NSObject
{
    NSString* _deviceId;
}

@property (nonatomic, retain) NSString* deviceId;

@end

And I’m trying to post this to a server, encoded as form key/value in the HTTP body.

I’m using the following to setup the mapping:

objectManager.serializationMIMEType = RKMIMETypeFormURLEncoded;

        RKObjectMapping* pmsg = [RKObjectMapping mappingForClass:[NSMutableDictionary class]];
        [pmsg mapKeyPath: @"deviceId" toAttribute:@"DeviceId"];

        RKObjectMapping* pmsgSerializeMapping = [pmsg inverseMapping];

        [objectManager.mappingProvider setSerializationMapping:pmsgSerializeMapping forClass:[LoginRequest class]];

        [objectManager.router routeClass:[LoginRequest class] toResourcePath:@"/login" forMethod:RKRequestMethodPOST];

This was taken from the example here: https://github.com/RestKit/RestKit/wiki/Posting-Data-Objects

I’m getting the following error:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<LoginRequest 0x8c9c980> valueForUndefinedKey:]: this class is not key value coding-compliant for the key DeviceId.'

Here’s how I’m trying to send my object:

RKObjectManager *objectManager = [RKObjectManager sharedManager];

LoginRequest* request = [LoginRequest alloc];
request.deviceId = @"Test";

[objectManager postObject:request delegate: self];

Can anyone help?

Update: I can confirm that when I don’t use the custom key-code mapping stuff, it works. The following I have working:

RKObjectMapping* pmsg = [RKObjectMapping mappingForClass:[NSMutableDictionary class]];
        [pmsg mapAttributes:@"DeviceId", nil];

        [objectManager.mappingProvider setSerializationMapping:pmsg forClass:[LoginRequest class]];

        [objectManager.router routeClass:[LoginRequest class] toResourcePath:@"/login" forMethod:RKRequestMethodPOST];
  • 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-12T06:53:49+00:00Added an answer on June 12, 2026 at 6:53 am

    Well, your property is named “deviceId”, which is lowercase. But you’re saying the attribute is “DeviceId” which starts with an uppercase “D”.

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

Sidebar

Related Questions

I realize this question has probably been asked numerous times, but I have not
I know this has probably been asked a million times, but how do I
You're probably thinking this has been asked a million times before but I think
This has probably been asked a thousand times... But i'm sure i have all
I know this has been asked probably a thousand times, but I've been biting
This probably has been asked before but all I can find are questions regarding
This has been asked a million times it appears, but I must be feeling
I think this has probably been asked, but after reading a lot, I'm not
I know that this has been asked a million times before, but nothing that
This has probably been asked before but I can't find it anywhere. I have

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.