我在Xcode 10 beta和iOS 12中工作。这是似乎不错的代码片段,它应做的事:
DispatchQueue.global().async {
guard let imageUrl = URL(string: course.imageUrl!) else { return }
guard let imageData = try? Data(contentsOf: imageUrl) else { return }
DispatchQueue.main.async {
cell.courseImage.image = UIImage(data: imageData)
}
}
下一行:
guard let imageData = try? Data(contentsOf: imageUrl) else { return }
在控制台中iOS 12上的模拟器中的下一个输出原因:
2018-09-07 12:02:25.045814 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_errorlog(224)[C1.1:2] [0x7fccdf534820] [boringssl_session_read] SSL_ERROR_SSL(1):操作失败 图书馆2018-09-07 12:02:25.045951 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_handshake_error_print(205) [C1.1:2] [0x7fccdf534820] 140517895636904:错误:100000d7:SSL
例程:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl_Sim/boringssl-109.200.32/ssl/ssl_lib.cc:1081: 2018-09-07 12:02:25.046072 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_errorlog(224)[C1.1:2] [0x7fccdf534820] [boringssl_session_read] SSL_ERROR_SSL(1):操作失败 图书馆2018-09-07 12:02:25.046208 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_handshake_error_print(205) [C1.1:2] [0x7fccdf534820] 140517895636904:错误:100000d7:SSL
例程:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl_Sim/boringssl-109.200.32/ssl/ssl_lib.cc:1081: 2018-09-07 12:02:25.049462 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_errorlog(224)[C1.1:2] [0x7fccdf534820] [boringssl_session_read] SSL_ERROR_SSL(1):操作失败 图书馆2018-09-07 12:02:25.049585 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_handshake_error_print(205) [C1.1:2] [0x7fccdf534820] 140517895636904:错误:100000d7:SSL
例程:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl_Sim/boringssl-109.200.32/ssl/ssl_lib.cc:1081: 2018-09-07 12:02:25.049732 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_errorlog(224)[C1.1:2] [0x7fccdf534820] [boringssl_session_read] SSL_ERROR_SSL(1):操作失败 图书馆2018-09-07 12:02:25.049998 + 0500联网[69467:3561679] [BoringSSL] boringssl_session_handshake_error_print(205) [C1.1:2] [0x7fccdf534820] 140517895636904:错误:100000d7:SSL
例程:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl_Sim/boringssl-109.200.32/ssl/ssl_lib.cc:1081:
如果我运行iOS 11.4模拟器,则控制台中的消息将是另一条消息,并且会在大约10-15秒后显示:
[BoringSSL]函数boringssl_session_errorlog:2881行 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6):操作失败 因为该连接已通过close_notify警报完全关闭
如果我像往常一样尝试从URL获取数据,为什么在控制台中会显示此消息?