gpt4 book ai didi

iphone - ASINetworkQueue setQueueDidFinishSelector 选择器提前结束?

转载 作者:行者123 更新时间:2023-12-03 20:53:47 25 4
gpt4 key购买 nike

我刚刚开始测试我构建的一些上传实用程序,并放置了 47 个项目进行上传,但队列在第 15、18 或 21 个项目处随机停止,不确定具体原因,但选择器被调用得太早虽然并不是所有的请求都结束了。

我所做的唯一特别的事情是将最大并发请求数提高到 6 而不是 4 ,但是这似乎不是一个大问题。

我按如下方式配置选择器:

[self.uploadQueue setDelegate: self];
[self.uploadQueue cancelAllOperations];
[self.uploadQueue setRequestDidStartSelector: @selector(uploadRequestStarted:)];
[self.uploadQueue setRequestDidFinishSelector:@selector(uploadRequestEnded:)];
[self.uploadQueue setQueueDidFinishSelector:@selector(uploadQueueEnded:)];
[self.uploadQueue setDownloadProgressDelegate: myProgress];
[self.uploadQueue showAccurateProgress];

这是我的日志:

2011-08-18 12:39:03.916 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView startUpload] Num requests: 47
2011-08-18 12:39:08.987 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #3 successfully!
2011-08-18 12:39:09.036 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #2 successfully!
2011-08-18 12:39:09.911 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #0 successfully!
2011-08-18 12:39:09.913 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #5 successfully!
2011-08-18 12:39:10.011 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #4 successfully!
2011-08-18 12:39:12.691 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #6 successfully!
2011-08-18 12:39:13.588 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #9 successfully!
2011-08-18 12:39:14.205 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #8 successfully!
2011-08-18 12:39:14.229 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #10 successfully!
2011-08-18 12:39:15.739 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #11 successfully!
2011-08-18 12:39:17.278 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #12 successfully!
2011-08-18 12:39:17.894 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #13 successfully!
2011-08-18 12:39:18.815 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #15 successfully!
2011-08-18 12:39:18.986 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadRequestEnded:] Finished uploading photo #14 successfully!
2011-08-18 12:39:19.191 MyTestApp[4240/0xacc992c0] [lvl=2] -[MyView uploadQueueEnded:] queue ended?

很想听听你们的任何建议:)提前致谢,谢。

最佳答案

您是否尝试过将 setShouldCancelAllRequestsOnFailure: 设置为 NO ?队列的默认行为是在任何单个请求失败时取消所有剩余请求。

可能是请求失败(由于某种原因),导致您的队列过早完成。

关于iphone - ASINetworkQueue setQueueDidFinishSelector 选择器提前结束?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7105631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com