1

i already found a way to convert a json string like {"a":"b"} to an nsdictionary in IOS. How do i convert a JSON String to a dictionary in IOS5

But is there a way to convert something like that "[{"a":"b"},{"a":"b"},{"a":"b"}]" to an nsarray with nsdictionaries?

I need that for my API but still found no solution.

Hope someone can help me! Thanks

Jonny

1
  • Just a guess: Use a JSON parser such as NSJSONSerialization. (Or any of the other half-dozen JSON parsers for Objective-C listed at json.org.) Commented Jun 28, 2014 at 16:10

1 Answer 1

1

It is exactly the same API. -JSONObjectWithData:options:error: will return an NSArray if the top-level item in your JSON is an array.

Sign up to request clarification or add additional context in comments.

1 Comment

yes i just had to define my variable as an NSArray instead of NSDictionary... stupid...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.