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.
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 :
Value Object :
Request :
In my CallBack function :
Finally I can map this Json :
I hope my exemple can help you.