I have a web server that is streaming JSON results back asynchronously to an iOS client. The client is connecting using NSURLConnection and I access the data from the method:
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData)
Data is currently coming back in 1024 byte chunks. However, I'm not sure how to tell if when I receive data if the message was complete other than appending all the data I receive to a string and try to parse it to JSON each time. This method seems quite error prone - is there a better way to handle this? Something that would mark in the headers or something when a full response has been sent?