Tuesday, 2 February 2016

NSMutableArray convert into Json data

NSMutableArray *allObjectArray = [[NSMutableArray alloc]init];

 [allObjectArray addObject:@"any value"];

 NSError *error;
 NSData *json_Data = [NSJSONSerialization dataWithJSONObject:allObjectArray
                                                                           options:NSJSONWritingPrettyPrinted
                                                                             error:&error];

  id jsonObject = [NSJSONSerialization JSONObjectWithData:json_Data options:NSJSONReadingMutableContainers error:nil];

No comments:

Post a Comment