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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:19:08+00:00 2026-05-29T11:19:08+00:00

please help so here is the problem i got a rails app that sends

  • 0

please help so here is the problem i got a rails app that sends a json image data base64. The json sends but when i try to access the data value in ios app it comes back as null. Here is my rails code,code

{
"profile_pic": "<%= Base64.encode64(File.read('/Users/rui_y/connect_Me2/public'+     
@user.avatar_photo_url(:thumb)).gsub("\n", '')) %>",
}

the json comes back as

[{"profile_pic": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcH......
  ....... many more lines etc etc...................................................
+p/Ob9Xrf6D8po/hOhI4U5SSm4Es8vUE/riYmJj2B0iefbkz/2Q==" }]

the Restkit is mapped like this

 [userMapping mapKeyPath:@"profile_pic" toAttribute:@"profilePic"];
 NSLog(@"people id %@",[[objects objectAtIndex:0]profilePic ]);
//and it comes back as null
2012-02-09 20:08:48.073 ConnecTest[78232:207] profile_pic (null)

all the other values when i nslog is accessable so im wondering how to map this data.

  • 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-29T11:19:08+00:00Added an answer on May 29, 2026 at 11:19 am

    You can map this as you do for all strings.

    I take this in my code, but I map a list of key/value object :

    Mapping :

    listMapping = [RKObjectMapping mappingForClass:[VOKeyValue class]];
    [listMapping mapKeyPath:@"value" toAttribute:@"value"];
    [listMapping mapKeyPath:@"key" toAttribute:@"key"];
    [[RKObjectManager sharedManager].mappingProvider setMapping:listMapping forKeyPath:@"list"];
    

    Value Object :

    @interface VOKeyValue : NSObject
    {
      NSString * key;
      NSString * value;
    }
    
    @property (nonatomic, retain) NSString * key;
    @property (nonatomic, retain) NSString * value;
    
    @end
    

    Request :

    [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"yourResourceURL..." delegate:self];
    

    In my CallBack function :

    VOKeyValue*img=[objects objectAtIndex:0];
    if (![img.key isEqualToString:@"image"]) {
      img=[objects objectAtIndex:1];
    }
    

    Finally I can map this Json :

    {"list":[{"key":"image","value":"/9j/4AATSkZJRgABAgIAAAAAAAAAAAD/wAARCADwAUADASEAAhEBAxEB/....YFJCPAP/ZAAA="},{"key":"other","value":"xxxx..."}]}
    

    I hope my exemple can help you.

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

Sidebar

Related Questions

I got a serious problem here: I have a scrolling background that is 1320
Please help me out here because im getting kind of confused.. I have a
Could someone please help me in here, I'm just a beginner who want to
I'm a developer and I suck at SQL:) Please help me out here. I'd
Please help, I am stuck here --- irb> a = line of text\n line
Please help me to rectify my code. Here I have described the code what
I am having a problem in installing devkit of ruby on rails. Here's the
Here is the problem: I have one giant string of xml data stored in
Ok I got a strange issue that I hope someone could help with I
I've been working on the 8 queens problem but I got stuck. I don't

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.