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 Build a Blog Reader iPhone App Getting Data from the Web Downloading and Parsing JSON Data

Adam Hill
Adam Hill
7,492 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,492 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.