MBProgressHUD 是否显示WhilePerformingSelector:在另一个线程上执行选定的方法?
我在我的项目中使用 MBProgressHUD
。我使用的方法 showWhilePerformingSelector:
正在调用一个利用 NSURLConnection
的方法。我在另一个 Stack Overflow 问题中读到,人们在辅助线程中使用 NSURLConnection 时遇到问题,因为该线程会在委托方法被触发之前被终止。
本质上,问题是,MBProgressHUD
的 showWhilePerformingSelector:
方法是否在不同的线程上运行所选方法?如果是这样,我将如何利用该主线程来运行我的 NSURLConnection ?
I'm utilizing MBProgressHUD
in my project. I'm using the method showWhilePerformingSelector:
which is calling a method which utilizes NSURLConnection
. I read in another Stack Overflow question that people were having trouble using NSURLConnection
in a secondary thread because the thread would be killed before the delegate methods could be fired.
In essence, the question is, does MBProgressHUD
's showWhilePerformingSelector:
method run the selected method on a different thread? If so, how would I go about utilizing that main thread to run my NSURLConnection
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用的是哪个版本的
MBProgressHUD
?在v0.4(最后一个),没有这样的方法。相反,是showWhileExecuting
,它表示:您应该做的是仅显示 HUD 并在委托被解雇时将其删除。您应该运行连接,而不是改进格式。只要您使用异步连接,一切都会好起来的。
像这个之类的东西。
Which version of
MBProgressHUD
are you using? At v0.4 (the last on), there is no such method. Instead isshowWhileExecuting
, which says:What you should do is show just the HUD and remove it when delegates are fired. You should run the connection, not the Improves formatting.. Everything will be OK as long as you use asynchronous connections.
Something like this.