0

ダウンロードに ASINetworkQueue を使用しています。次のコードを使用しています。

requestUserSpecificFileQueue = [ASINetworkQueue queue];
    failed = NO;
//    [requestUserSpecificFileQueue reset];
    NSDictionary *dictLocal=[_objectArray objectAtIndex:bookViewSelected.tag];
    UIProgressView *progressView=[[UIProgressView alloc]initWithFrame:CGRectMake(5, 190, 200, 20)];
    [bookViewSelected addSubview:progressView];
    [requestUserSpecificFileQueue setDelegate:nil];
    [requestUserSpecificFileQueue setDownloadProgressDelegate:progressView];
    [requestUserSpecificFileQueue setRequestDidFinishSelector:@selector(downLoadFinished:)];
    [requestUserSpecificFileQueue setRequestDidFailSelector:@selector(downloadFailed:)];
    [requestUserSpecificFileQueue setShowAccurateProgress:YES];
    progressView.tag=bookViewSelected.tag;
    [requestUserSpecificFileQueue setShouldCancelAllRequestsOnFailure:NO];
//    requestUserSpecificFileQueue.name=[NSString stringWithFormat:@"%d",bookViewSelected.index];
    ASIHTTPRequest *requestUserSpecificFile=[ASIHTTPRequest requestWithURL:[dict objectForKey:@"object"]];
    requestUserSpecificFile.tag=bookViewSelected.tag;
    [requestUserSpecificFile setDownloadDestinationPath:[[self returnUnzipBundlePathName] stringByAppendingPathComponent:dictLocal[@"fullLengthFilename"]]];

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
    [requestUserSpecificFile setShouldContinueWhenAppEntersBackground:YES];
#endif
    [requestUserSpecificFileQueue addOperation:requestUserSpecificFile];
    [requestUserSpecificFileQueue go];

ビューコントローラーをプッシュしてから戻ってくると、アプリが EXC_BAD_ACCSS でクラッシュします アプリがメソッドでクラッシュします--

[ASIHTTPRequest updateProgressIndicator:&downloadProgressDelegate withProgress:[self bytesDownloadedSoFar] ofTotal:[self totalBytesToDownload]];
4

1 に答える 1

2

ASIHTTPRequest は非推奨であり、維持されていません。代わりにAFNetworkingを使用してください

于 2013-05-29T15:44:14.553 に答える