ASIHTTPRequest setDownloadDestinationPath 崩溃

发布于 2024-11-26 16:11:22 字数 821 浏览 1 评论 0原文

我有这个简单的代码:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灯角 2024-12-03 16:11:22

通过将最小构建设置从 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文