ios - 无法理解崩溃日志部分应用转发器来关闭 #1

标签 ios swift crash-reports

我遇到了曲棍球应用程序崩溃问题

Thread 0 Crashed:
0   App                         0x000000010302e7f8 partial apply forwarder for closure #1 (__C.UIImage?, [Swift.AnyHashable : Any]?) -> () in static App.ImageLoader.image(from: __C.PHAsset, size: __C_Synthesized.CGSize, success: (__C.UIImage) -> ()) -> () (PhotoLibraryImageLoader.swift:28)
1   App                         0x000000010302d958 reabstraction thunk helper from @escaping @callee_guaranteed (@owned __C.UIImage?, @owned [Swift.AnyHashable : Any]?) -> () to @escaping @callee_unowned @convention(block) (@unowned __C.UIImage?, @unowned __C.NSDictionary?) -> () (PhotoLibraryImageLoader.swift:0)
2   Photos                               0x00000001917c89cc __84-[PHImageManager requestImageForAsset:targetSize:contentMode:options:resultHandler:]_block_invoke.1505 + 816

在 PhotoLibraryImageLoader.swift 中

static func image(from assest:PHAsset,size:CGSize,success:@escaping (_ image:UIImage) -> Void) {
        let option = PHImageRequestOptions()
        option.isSynchronous = false
        option.deliveryMode = .highQualityFormat
        PHImageManager.default().requestImage(for: assest, targetSize: size, contentMode: .aspectFill, options: option) { (image, attributes) in
            success(image!) // Crash line  PhotoLibraryImageLoader.swift:28
        }
 }

如果可选(图像!)存在问题,崩溃日志应该有所不同(例如意外发现 nil..)

这里部分申请转发器关闭是什么意思

有人可以帮我了解一下吗?

最佳答案

图像不可用导致崩溃(需要从服务器下载)

为此,请在选项中添加一行

    option.isNetworkAccessAllowed = true

希望对大家有帮助

关于ios - 无法理解崩溃日志部分应用转发器来关闭 #1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52379190/

相关文章:

ios - AVCaptureSession 崩溃

iOS:当我尝试使用西方字体显示日语字符时,如何找出使用的 "fallback font"?

iOS Firebase 身份验证域对用户可见

iphone - UIViewController 旋转方法

ios - 在 Crashlytics 中没有获得崩溃报告?

ios - 在 Xcode 调试 session 之外查看 iOS 应用程序崩溃日志的方法?

ios - 根据用户触摸计算角度

ios - 如何让Xcode自动符合协议(protocol)

ios - Swift bool 自己改变

android - S9/S9+ 特定 WebView 设备崩溃报告