问题
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