I'm making a TCP protocol where an app sends JSON to a server and it sends JSON back. I am trying to delimit each transmission with a newline. This is fine on the server side, but how do you add a newline to each NSOutputStream write?
The streams are set-up correctly and here's the code I'm using to send data:
NSInteger sendJSON = [NSJSONSerialization writeJSONObject:dictionary toStream:self.outputStream options:0 error:nil];
How do you add a newline (\n
) to the end of that, surely there's a way?