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:类型];
请协助
问候, 账单。
I have this simple code:
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];
I am using setDownloadDestinationPath in order to write the file to disk directly, and not in memory. The file is 80MB so is crashing on the device when downloading in memory.
Code works fine in the simulator, but on the device is crashing with:
Thread 2: Program received signal: EXC_BAD_INSTRUCTION.
[((ASIHTTPRequest*)clientCallBackInfo) handleNetworkEvent: type];
Please assist
regards,
Bill.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将最小构建设置从 4.0 交换到 4.1 来解决。
也许 4.0 缺少一些东西。
谢谢...
Solved by swapping minimum build settings from 4.0 to 4.1.
Maybe something was missing from 4.0.
Thanks...