切换到视图控制器时,应用程序崩溃

时间:2013-05-29 15:14:27

标签: iphone ios asihttprequest xcode4.6

我正在使用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];

当我pushViewcontroller然后回来我的应用程序崩溃与EXC_BAD_ACCSS 应用程序在方法中崩溃 -

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

1 个答案:

答案 0 :(得分:2)

ASIHTTPRequest已弃用且不再维护,请改用<{3}}