Wednesday 14 November 2012

RestKit: Could not find an object mapping for keyPath: ' '

RestKit is an excellent Objective-C framework to make dealing with downloading and uploading data to and from a REST-based server considerably simpler than coding it all yourself.

When I started out I found it pretty straightforward until I hit a REST command that returned a JSON array at the root object, where I ran into the dreaded Could not find an object mapping for keyPath: ' ' error.

Here's an example REST response that caused this error:

[ { "name":"foo"}, { "name":"bar"} ]

It seems restkit expects there to be a root level object e.g. 

{ "data": [ { "name":"foo"}, { "name":"bar"} ] }

If your server doesn't do this, and you can't change it, then the automatic mapping system doesn't seem to work.

The solution is pretty simple (manually tell the system which mapping to use) but I took me a while to figure out, so I thought it might help others if I posted it here.




16 comments:

  1. Susunan angka dari setiap kartu itu memiliki nilai 6, contohnya 3-3, 2-4, 1-5, dan 0-6 Kombinasi kartu 4 balak, kombinasi yang mempunyai angka sama dari setiap kartu, contohnya, 1-1, 2-2, 3-3, 4-4, 5-5, dan 6-6.
    asikqq
    dewaqq
    sumoqq
    interqq
    pionpoker
    bandar ceme terpercaya
    hobiqq
    paito warna terlengkap
    bocoran sgp

    ReplyDelete
  2. This is a fantastic website, thanks for sharing. There's no doubt i would fully rate it after i read what the idea about this article is. You did a nice job 먹튀검증

    ReplyDelete
  3. You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this. 먹튀검증

    ReplyDelete
  4. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates. 메이저놀이터

    ReplyDelete
  5. I'm constantly searching on the internet for posts that will help me. Too much is clearly to learn about this. I believe you created good quality items in Functions also. Keep working, congrats! 먹튀폴리스

    ReplyDelete
  6. Thanks for the blog post buddy! Keep them coming. 토토사이트

    ReplyDelete
  7. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include 안전놀이터
    Regular visits listed here are the easiest method to appreciate your energy, which is why why I am going to the website everyday, searching for new, interesting info. Many, thank you 안전놀이터

    ReplyDelete
  8. This is actually the kind of information I have been trying to find. Thank you for writing this information 토토사이트

    ReplyDelete
  9. retty 좋은 게시물. 방금 귀하의 블로그를 우연히 발견하고 귀하의 블로그 게시물을 읽는 것이 정말 즐거웠다고 말하고 싶었습니다. 어떤 식 으로든 피드를 구독하고 곧 다시 게시 해 주시기 바랍니다. 유용한 정보에 감사드립니다. 먹튀검증업체

    ReplyDelete
  10. Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work. 먹튀폴리스

    ReplyDelete
  11. i read a lot of stuff and i found that the way of writing to clearifing that exactly want to say was very good so i am impressed and ilike to come again in future.. 먹튀폴리스

    ReplyDelete
  12. I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious.. 토토사이트

    ReplyDelete
  13. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also 먹튀검증

    ReplyDelete
  14. HVAC & Plumbing Services
    Air Star Heating guarantees reliability and quality for all equipment and services.

    Air Star Heating specialists always try to deliver the most excellent quality of services to our customers at an affordable price. It is understood that every client has different needs and different problems. We try to accomplish the needs of every client according to their requests. We are having considerable experience in this field. Our specialists understand very well how things work. It doesn’t matter in which field of industry you are looking for services.
    Plumbing & HVAC Services in San Diego. Call now (858) 900-9977 ✓Licensed & Insured ✓Certified Experts ✓Same Day Appointment ✓Original Parts Only ✓Warranty On Every Job.
    Visit:- https://airstarheating.com

    ReplyDelete
  15. here you can get the free premium apps in free thorugh 슬롯사이트

    ReplyDelete