0

Is it possible to get and parse JSON using objective C, then manipulate it within the cocoa framework for the iphone/pad? I'm specifically looking to do this for a couple of public APIs out there.

1

5 Answers 5

2

See here: how to do json parsing in iphone

Basically, you should look into the TouchJSON library (with CJSONDeserializer and CJSONSerializer).

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

Comments

1

Used Json-framework on some previous projects, worked really well.

EDIT: I read your post a bit too fast. I've used it on a Mac app before but not targeting the iphone/ipad. I think it should work but have no background to it. Maybe someone else can confirm?

Comments

1

It's not only possible, it's dirt simple if you use one of the many existing open source projects dedicated to this task. I recommend trying yajl-objc, which offers a streaming parser, but json-framework is a good one too. They're very similar.

Comments

0

I'd stay away from TouchJSON, since it gave me trouble a while back with special characters (line breaks) in strings.

However, I'll join the choir recommending json-framework. Since I switched to that from TouchJSON everything's been running smoothly.

Regarding how to integrate the API in your project, they're equally simple to include and use.

As a side note, I'm just now testing out JSONKit, since it's supposed to be much faster than both TouchJSON and json-framework. However, I can't vouch for its stability yet. The reviews of it are good, though.

Comments

0

If you're developing an application that is only iOS 5.0 or later, you can use NSJSONSerialization.

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.