Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [0 nan; 414 nan]'

昨晚项目经理找我说:新添加的数据怎么不显示图片,然后今天早上上班运行就崩溃了,就是:

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [0 nan; 414 nan]'

然后一查看后台返回的数据,去你大爷的,返回的URL有中文 ,需要将中文的URL通过utf8转码即可使用


什么鬼,然后就想到动态计算图片高度,果然,就是因为中文的URL,导致获取不到图片,照片宽高都是0,所以导致崩溃了,(题外话:为什么图片高度要前端计算,一般不都是后台计算好返回来的吗?)

https://www.jianshu.com/p/102afbffaac1

你可能感兴趣的:(Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [0 nan; 414 nan]')