网络请求数据写成plist//请求参数是要求传JSON数据

NSString *p = @"/Users/mac/Desktop/九宫格图片处理";
NSString *ps = [p stringByAppendingPathComponent:@"data.plist"];
[parameters writeToFile:ps atomically:YES];

ShopingCar *model = _shopingCarArr[row];
    NSMutableArray *mArr = [NSMutableArray array];
    mArr = @[@{@"goodsId":model.goodsId,
               @"amount":[NSString stringWithFormat:@"%zd",model.quantity]}].mutableCopy;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:mArr options:0 error:nil];
    NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

你可能感兴趣的:(网络请求数据写成plist//请求参数是要求传JSON数据)