Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

JSON with IOS

i know in the blog reading app that it shows you the JSON and how to connect it to the app to read the info from it and display it, but how do you create the JSON information, how do you create one of you own and read from the any internet site or even multiple web sites

3 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

A lot of websites provide a REST API which offers the website data in JSON format.

Few examples:

If you have a Wordpress site then you can add a JSON API to it using this plugin: JSON API Plugin and add this method to it: https://gist.github.com/abijlani/5072444

Depending on the server side language of your application you can create a JSON API very easily. Essentially, you take data from the server database and expose it in a JSON format.

I have a WordPress.com site rather than a WordPress.org site. From my understanding, this means I can't install the plugin.

How can I get my blog data in json format or other format?

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

You can use services like ifttt or kimonolabs to expose your blog data in JSON format.

hi amit i am using ios xcode 4.1 version i was going through all the modules one by one and i am struck at json parsing video.this is showing me an error that use of undeclared identifier 'NSJSONSerilazation' .can you please help me i am new the ios programming

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

You would have to install at least Xcode 4.2 because NSJSONSerialization is a class only available in iOS 5. If you are using Snow Leopard then you can download Xcode 4.2 from here: https://developer.apple.com/downloads

PS. for future reference please create a new post for an issue that is unrelated to the original posting.

thats great thanks, also i was wondering what format do the videos have to be that are being played on mobile devices

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

iOS supports the following file formats: H.264, MPEG-4 in .mp4, .m4v, .mov file formats