Alexis
Alexis

Reputation: 16829

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

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

Upvotes: 4

Views: 2730

Answers (1)

Wain
Wain

Reputation: 119031

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.

Upvotes: 4

Related Questions