RestKit: how to fetch a simple JSON array of strings?

久未见 提交于 2019-12-10 16:27:38

问题


How should I use RestKit to fetch a JSON array of strings like this :

["Paris", "London", "Brussels", "New York"]

I tried to make an object mapping but since there's no key path or attribute, I don't know what to map.

I don't even need a mapping, the result could just be an array or a dictionary. Is there a way to achieve that?

EDIT:

For more info & solution : https://github.com/RestKit/RestKit/issues/1290


回答1:


You need to create a mapping with a nil keypath. This instructs RestKit to directly map the string values into your destination objects. See this reference.



来源:https://stackoverflow.com/questions/18646442/restkit-how-to-fetch-a-simple-json-array-of-strings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!