From 88674f67b8649536ff9a490f01e4de7ad7f45ae1 Mon Sep 17 00:00:00 2001 From: CoderMuMu <674057373@qq.com> Date: Sat, 25 Jun 2016 19:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8F=91=E7=8E=B0=E4=B8=AAcrash?= =?UTF-8?q?=E3=80=91=E7=82=B9=E5=87=BB=E7=AC=AC=E4=B8=80=E4=B8=AA=E3=80=90?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8B=E8=BD=BD=E3=80=91--=E3=80=8B?= =?UTF-8?q?=E3=80=90=E6=8C=89=E9=92=AE=E5=88=A0=E9=99=A4=E3=80=91--?= =?UTF-8?q?=E3=80=8B=E3=80=90=E6=8C=89=E9=92=AE=E6=B8=85=E9=99=A4=E3=80=91?= =?UTF-8?q?=20=E7=A8=8B=E5=BA=8F=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原因:是SessionModel对象被释放-》nil 解决方案 :对SessionModel对象进行非空处理 --- HSDownloadManager/HSDownloadManager.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HSDownloadManager/HSDownloadManager.m b/HSDownloadManager/HSDownloadManager.m index 892fdb2..0fe1a28 100644 --- a/HSDownloadManager/HSDownloadManager.m +++ b/HSDownloadManager/HSDownloadManager.m @@ -310,7 +310,9 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data NSUInteger expectedSize = sessionModel.totalLength; CGFloat progress = 1.0 * receivedSize / expectedSize; - sessionModel.progressBlock(receivedSize, expectedSize, progress); + if (sessionModel) { + sessionModel.progressBlock(receivedSize, expectedSize, progress); + } } /**