Posts

Post not yet marked as solved
14 Replies
4.9k Views
When a batch of download tasks create and resume, some of them are still downloading. Xcode kill the app, and launch app again, then all the tasks failed immediately(if not reproduce, retry these steps). The worst thing is whenever i add new tasks and resume, all of them failed immediately, until i restart the app.I can produce this bug everytime, just follow these tips:NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@"***"];NSOperationQueue* operationQueue = [[NSOperationQueue alloc] init];operationQueue.maxConcurrentOperationCount = 1;urlsession = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:operationQueue];for (int i = 0; i < 100; i++){ NSURLSessionDownloadTask* downloadTask = [urlsession downloadTaskWithRequest:urlRequest]; [ downloadTask resume];}Xcode kill the app...Xcode launch app again...The only delegate method be called immediately is:- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)errorError Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSErrorFailingURLKey=xx'xx'x'xxxx, NSErrorFailingURLStringKey=***}It's not certain appearing on devices not kill by xcode, but my QA colleagues sometimes got this bug and report to me.Only background session has this bug, defaultSessionConfiguration won't happen.I don't know why "No such file or directory" error is called back, any suggestions?
Posted Last updated
.
Post not yet marked as solved
2 Replies
849 Views
hi,I got an crash in my App(only iOS11 and below), accidental appearance. Has no clue why this comes from, and how to avoid?In my viewcontroller BBANovelWiseToNAReaderVC , implemention of UIScrollViewDelegate - (void)scrollViewDidScroll:(UIScrollView *)scrollView { ..... [self.collectionView layoutAttributesForItemAtIndexPath:bottomIndexPath]; // here crash! ....}Crash stacks:Thread 0 Crashed: Queue: com.apple.main-thread 0UIKit -[UICollectionViewData layoutAttributesForItemAtIndexPath:] (in UIKit) + 244 1UIKit -[UICollectionView layoutAttributesForItemAtIndexPath:] (in UIKit) + 60 2BaiduBoxApp -[BBANovelWiseToNAReaderVC scrollViewDidScroll:] (in BaiduBoxApp) (BBANovelWiseToNAReaderVC.m:0) 3UIKit -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] (in UIKit) + 76 4UIKit -[UIScrollView setContentOffset:] (in UIKit) + 460 5UIKit -[UIScrollViewScrollAnimation setProgress:] (in UIKit) + 308 6UIKit -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] (in UIKit) + 280 7QuartzCore CA::Display::DisplayLinkItem::dispatch() (in QuartzCore) + 40 8QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) (in QuartzCore) + 424 9 IOKit IODispatchCalloutFromCFMessage (in IOKit) + 372 10CoreFoundation __CFMachPortPerform (in CoreFoundation) + 180 11CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ (in CoreFoundation) + 56 12 CoreFoundation __CFRunLoopDoSource1 (in CoreFoundation) + 436 13CoreFoundation __CFRunLoopRun (in CoreFoundation) + 1800 14CoreFoundation CFRunLoopRunSpecific (in CoreFoundation) + 384 15GraphicsServices GSEventRunModal (in GraphicsServices) + 180 16UIKit UIApplicationMain (in UIKit) + 204 17BaiduBoxApp main (in BaiduBoxApp) (main.m:24) 18 ??? 0x00000001816f28b8 0x0 + 0
Posted Last updated
.