简体   繁体   English

使用AFNetworking在UICollectionView中异步下载错误

[英]Asynchronous downloading in UICollectionView error with AFNetworking

Hi I'm creating Uicollection view with list ofcatalogs, While tapping on cell the PDF have to download, Its working in one view perfectly but in another view gives the error 嗨,我正在创建带有目录列表的Uicollection视图,在点击PDF单元格必须下载时,它在一个视图中完美运行,但在另一个视图中却给出了错误

* thread #1: tid = 0x4b2ce, 0x000000018d14f9b8 CoreFoundation`CFURLCopyScheme + 56, queue =   'com.apple.NSURLSession-work', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x000000018d14f9b8 CoreFoundation`CFURLCopyScheme + 56
frame #1: 0x000000018cdab96c CFNetwork`_urlIsHTTPish + 16
frame #2: 0x000000018cdc76b0   CFNetwork`URLRequest::addOverridingSessionAttributes(_CFURLSessionConfiguration*) + 288
frame #3: 0x000000018ce38964 CFNetwork`ClassicConnectionSession::createConnectionWithProperties(_CFURLRequest const*, __CFDictionary const*) const + 548
frame #4: 0x000000018ce10bcc CFNetwork`__73-[__NSCFLocalSessionBridge downloadTaskForRequest:resumeData:completion:]_block_invoke + 224
frame #5: 0x000000019a0abfd4 libdispatch.dylib`_dispatch_client_callout + 16
frame #6: 0x000000019a0b1c84 libdispatch.dylib`_dispatch_barrier_sync_f_invoke + 48
frame #7: 0x000000018cd977f4 CFNetwork`-[__NSCFLocalSessionTask resume] + 108
* frame #8: 0x00000001001b34d0 HSPCatalogApp`-[MRItem AsynchronousDownload12:]    (self=0x0000000170297110, _cmd=0x00000001005a3109, UrlString=0x00000001700fd800) + 548 at MRItem.m:154
frame #9: 0x00000001001b3084 HSPCatalogApp`-[MRItem downloadItem](self=0x0000000170297110, _cmd=0x0000000100599f1f) + 652 at MRItem.m:56
frame #10: 0x00000001000f7c6c HSPCatalogApp`-[HWFilterViewController collectionView:didSelectItemAtIndexPath:](self=0x0000000125568ae0, _cmd=0x00000001908d74db, collectionView=0x00000001258c2a00, indexPath=0xc000000000008016) + 960 at HWFilterViewController.m:484
frame #11: 0x0000000190428d44 UIKit`-[UICollectionView touchesEnded:withEvent:] + 448
frame #12: 0x00000001903875e0 UIKit`forwardTouchMethod + 268
frame #13: 0x00000001903875e0 UIKit`forwardTouchMethod + 268
frame #14: 0x00000001901d5df4 UIKit`_UIGestureRecognizerUpdate + 5032
frame #15: 0x0000000190213b08 UIKit`-[UIWindow _sendGesturesForEvent:] + 1012
frame #16: 0x0000000190213218 UIKit`-[UIWindow sendEvent:] + 828
frame #17: 0x00000001901e4b50 UIKit`-[UIApplication sendEvent:] + 256
frame #18: 0x00000001901e2c40 UIKit`_UIApplicationHandleEventQueue + 8500
frame #19: 0x000000018d1db7f4 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #20: 0x000000018d1dab50 CoreFoundation`__CFRunLoopDoSources0 + 256
frame #21: 0x000000018d1d8de8 CoreFoundation`__CFRunLoopRun + 632
frame #22: 0x000000018d119dd0 CoreFoundation`CFRunLoopRunSpecific + 452
frame #23: 0x0000000192da9c0c GraphicsServices`GSEventRunModal + 168
frame #24: 0x000000019024afc4 UIKit`UIApplicationMain + 1156
frame #25: 0x000000010013e64c HSPCatalogApp`main(argc=1, argv=0x000000016fd17c98) + 116 at main.m:16
frame #26: 0x000000019a0c7aa0 libdyld.dylib`start + 4

thanks in advance. 提前致谢。

CFURLCopyScheme crashed as CFURL passed to this method is nil, iOS7 does not check if url passed to NSURLSessionDownloadTask is valid. CFURLCopyScheme崩溃,因为传递给此方法的CFURL为nil,iOS7不检查传递给NSURLSessionDownloadTask的URL是否有效。

Check that: 检查:

1) NSURL passed to request downloadTaskWithRequest was not nil 1)传递给请求downloadTaskWithRequest的NSURL不为零

2) NSURL does not contain invalid characters eg: 2)NSURL不包含无效字符,例如:

% |{}><"\`

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM