iOS 开发进阶anroid

iOS json解析失精度

2018-11-30  本文已影响11人  屈涯
  Podfile 添加 
  # JSONModel
  pod 'JSONModel'
    NSError *error;
    // 获取文件路径
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"saleFinish" ofType:@"json"];
    // 根据文件路径读取数据
    NSData *jdata = [[NSData alloc] initWithContentsOfFile:filePath];
    //data转模型
    YHExchangeSeckillResponse *jsonModel = [[YHExchangeSeckillResponse alloc] initWithData:jdata error:nil];
上一篇 下一篇

猜你喜欢

热点阅读