0

I have JSON string of following format, which need to be parsed in objective-c

[{"image":"<link_to_image>",
  "pic-number":"2862",
  "n-lines":5,
  "default":"[{"line_1":"one!"},
              {"line_2":"two"},
              {"line_3":"three"},
              {"line_4":"four"},
              {"line_5":"five"}]"
}, 
... ]

The length of default array may vary for each item.

1
  • 1
    And accept your answer if you got the solution... Commented May 4, 2011 at 11:15

2 Answers 2

2

Try TouchJSON which is available in:

http://code.google.com/p/touchcode/

And also go through these

How to use touch json and sbjson

how to do json parsing in iphone

How to parse JSON into Objective C - SBJSON

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

Comments

1

Just found the cause of the problem,

Instead

  "default":**"**[{"line_1":"one!"},
              {"line_2":"two"},
              {"line_3":"three"},
              {"line_4":"four"},
              {"line_5":"five"}]**"**

The JSON string should has following format otherwise the parsing will fail

  "default":[{"line_1":"one!"},
              {"line_2":"two"},
              {"line_3":"three"},
              {"line_4":"four"},
              {"line_5":"five"}]

Comments

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.