崩溃现象
2023-06-29 18:25:04.476791+0800 ShortPlay[23548:2421105] *** Assertion failure in -[_UIImageCGImageContent initWithCGImage:scale:], /Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3920.31.101/_UIImageContent.m:336
2023-06-29 18:25:04.497342+0800 ShortPlay[23548:2421105] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Need an imageRef'
*** First throw call stack:
(0x18f409794 0x18f12bbcc 0x18f30c82c 0x18f74416c 0x192f697c8 0x193101b18 0x193821be0 0x193823fd4 0x193137ec4 0x193823f14 0x193821870 0x193821364 0x193821f44 0x1930f0c74 0x10055b6b0 0x10055b658 0x192e68750 0x192e6d1e0 0x192e6d5e8 0x192dcce5c 0x192de0d24 0x192de20c4 0x192dc5624 0x19396485c 0x195ef7724 0x195efd87c 0x195f083c0 0x195e50f1c 0x195e7a8bc 0x1934d9a30 0x18f38706c 0x18f381f60 0x18f3823dc 0x18f381ce8 0x1994cc38c 0x1934b0444 0x100569854 0x18f2098f0)
libc++abi.dylib: terminating with uncaught exception of type NSException
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Need an imageRef'
崩溃由来
[UIImage imageNamed:@"login_back"]
使用该方法获取 存放在 Assets 中的图片资源。
崩溃原因
该图片资源的二倍图,三倍图都是 以 .jpg形式结尾的。因此无法解析。修改图片格式可解决该问题
注意:
该崩溃出现在iOS13.5.1的系统上,在高系统上没有该现象