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

Parsing a file with multiple newline-delimited JSON objects?

Hey guys. I'm trying to use NSJSONSerialization to parse through a JSON file with multiple, newline-delimited objects, but it seems it only works on a file with one JSON object. It returns null after I go through the process of establishing a data pointer to the contents of the file.

I'd like to do this without involving external APIs/frameworks/categories/whatever. Anybody know how to do this internally in Objective-C?

http://i58.tinypic.com/vscqkh.png

1 Answer

John Ek
John Ek
1,899 Points

Are you able to wrap the menu elements in a menus tag?

I have an array of documents and I wrapped them in a SyncDocs and it works fine. Then you can do a for each which is nice. { SyncDocs: [ { Document: {id: "7"} }, { Document: {id: "8"} } ] }