异常一
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
原因
计算高度,宽度,CGRectMake设置等中存在错误,看看是不是除0等操作了
异常二
CALayer position contains NaN: [187.5 nan]. Layer: <CALayer:0x281d9c0a0; position = CGPoint (100 100); bounds = CGRect (0 0; 200 200); delegate = <UIImageView: 0x101a8cc50; frame = (0 0; 200 200); gestureRecognizers = <NSArray: 0x2816f39c0>; layer = <CALayer: 0x281d9c0a0>>; opaque = YES; allowsGroupOpacity = YES; >
这种下面会有一串的 block_invoke错误,这时候不要在意这些细节,抓住主要矛盾,主要排查看看是否有四则运算没有考虑全作用域 即可
参考链接:https://www.jianshu.com/p/b1b8d8eab874