0
我有這個簡單的代碼:ASIHTTPRequest setDownloadDestinationPath崩潰
NSURL *urltmp = downloadContentURL;
NSURL *url = [urltmp URLByAppendingPathComponent:file];
NSLog(@"url is: %@", url);
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDownloadDestinationPath:[self applicationSupportDirectoryWithFilename:file]];
[request setDidFinishSelector:@selector(requestFinished:)];
[request setDelegate:self];
[request setDidFailSelector:@selector(requestFailed:)];
[request setShowAccurateProgress:YES];
[request setDownloadProgressDelegate:self];
[request startAsynchronous];
我使用setDownloadDestinationPath,以便直接將文件寫入磁盤,而不是在內存中。該文件爲80MB,因此在內存中下載時會在設備上崩潰。
代碼在模擬器上工作正常,但在設備上與崩潰:
線程2:程序接收到的信號:EXC_BAD_INSTRUCTION。 [((ASIHTTPRequest *)clientCallBackInfo)handleNetworkEvent:type];
請協助
問候, 比爾。