iOS字典或数组转为json

    NSData *data = [NSJSONSerialization dataWithJSONObject:@[params] options:NSJSONWritingPrettyPrinted error:nil];

    NSString *josn = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];



注意:只能转字典额数组

你可能感兴趣的:(iOS字典或数组转为json)