iOS json解析失精度

作者: 屈涯 | 来源:发表于2018-11-30 13:58 被阅读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];

相关文章

网友评论

    本文标题:iOS json解析失精度

    本文链接:https://www.haomeiwen.com/subject/mdchcqtx.html