I am creating a JSON array using Objective C. I have never done this before but what I would like to do is create the JSON array then make a JSON pair that I use to send back in my NSURLConnection Post body.
I know how to make and send the post body.
NSData *data = // some stuff in here...
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:[NSString stringWithFormat:@"%d", [data length]] forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody:data];
How do I first of all create the JSON array, then how do I make the JSON pair?