Friday, 1 November 2013

JSON string From NSDictionary

NSDictionary *jsondict;

NSData *jsonData=[NSJSONSerialization dataWithJSONObject:jsondict options:NSJSONWritingPrettyPrinted error:Nil];

NSString *jsonStr=[[NSString alloc]initWithData: jsonData encoding:NSUTF8StringEncoding];


 jsonStr =[jsonStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

No comments:

Post a Comment