NSDictionary *param = @{@"key1":@"value1",@"key2":@"value2"}; NSError *parseError = nil; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:param options:NSJSONWritingPrettyPrinted error:&parseError]; NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
时间: 2024-10-06 22:02:37