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];
请协助
问候, 比尔。