Hi Jens, Thanks for this, makes sense. I didn't see your response before I made my post below. SBJSON seems to be doing the trick though.
Thanks again, Jared On Saturday, April 11, 2015 at 12:26:24 PM UTC-7, Jens Alfke wrote: > > > On Apr 11, 2015, at 6:30 AM, Jared McFarland <[email protected] > <javascript:>> wrote: > > However, the whole point of LDSON is that you don't have to wait for the > entire response, so I'm trying to figure out the best way to go about > parsing the data as it streams in > > > Just accumulate the incoming data into an NSMutableData object. After you > append new bytes, look for a newline in the data (probably using memchr or > something like that). If you find one, copy the bytes from the start to > just before the newline into a new NSData, then use NSJSONSerialization to > parse it. Then delete the consumed bytes (including the newline) from the > mutable data buffer. > > —Jens > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/931f10af-89d1-42b7-8568-e2f2f5f258c0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
