Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Blog Reader iPhone App Getting Data from the Web Downloading and Parsing JSON Data

Adam Hill
Adam Hill
7,491 Points

Downloading and Parsing JSON Data

I'm a little stuck on how to display the JSON data if the format doesn't match the treehouse feed.

Ie instead of having:- { "posts": [

my feed just starts :- [

So I have no objectForKey to access.

So far I've tried swapping:-

self.blogPosts = [dataDictionary objectForKey:@"posts"];

for:-

self.blogPosts = dataDictionary;

That works (simulator only, won't open on a phone), but I do get a warning about Incompatible pointer types so is there a better / proper way of doing it?

1 Answer

Adam Hill
Adam Hill
7,491 Points

No one knows it seems, so looked at different JSON feed generation tools instead till I could find one that output the required format. Still interested to know if it's possible to use a different format JSON with this method though.