YYModel icon indicating copy to clipboard operation
YYModel copied to clipboard

如果解析出错, 如何记录这个错误

Open oushizishu opened this issue 9 years ago • 2 comments

首先表示对大神开源代码的尊敬和感谢. 因为要把老项目里面的Mantle换成YYModel, 发现Mantle在解析的时候,比如方法 + (id)modelOfClass:(Class)modelClass fromJSONDictionary:(NSDictionary *)JSONDictionary error:(NSError **)error, 提供了一个error地址的参数, 用于记录解析或者初始化模型类出错的情况, 然后查看YYModel的源码, 有说 "@return A new instance created from the json, or nil if an error occurs" ,但是如果return nil的时候, 我该如何记录这个error? 再次感谢大神.

oushizishu avatar Nov 28 '16 02:11 oushizishu

我也表示有相同的需求,在项目前期调试接口时,经常出现字段名字不一致,一般都是字母大小写问题,或者数组转字典,这种问题很难发现,所以希望大神能实现这种功能或者给个思路。

gocse avatar Dec 06 '16 08:12 gocse

+1 ,判断转换是否出错感觉还是很必要的

zenghaojim33 avatar Mar 11 '17 02:03 zenghaojim33