I used the following code :
[dict setObject:[NSString stringWithFormat:@"%d",1] forKey:@"res_id"];
//[dict setObject:categoryId forKey:@"category"];
NSArray * values = [cartDict allValues];
NSString *request1 = [dict JSONRepresentation];
NSLog(request1);
NSDictionary *req = [NSDictionary dictionaryWithObject:dict forKey:@""];
//convert object to data
NSData *jsonData = [NSData dataWithBytes:[request1 UTF8String] length:[request1 length]];
//print out the data contents
NSString *json1 = [[NSString alloc] initWithData:jsonData
encoding:NSUTF8StringEncoding];
NSLog(@"JSON>>>>>%@",json1);
Dude your code is too messy
Try this simple example hope you get your idea. It is printing the same thing that you need