iPhone - NSThread 和 NSURLConnection 的问题
在我的 iPhone 应用程序中,我正在创建 NSThread 并运行一些代码。在同一个线程中,我正在使用 NSURLConnection 并尝试从服务器获取一些数据。我实现了与连接相关的所有委托。在线程中,我还有以下代码来等待从服务器获取数据的完成:
while (threadFinished == NO) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}
但它会立即崩溃到上面代码的下一行。它只是说 EXC_BAD_ACCESS。 有人可以指导我解决这个问题吗?
In my iphone application, i'm creating NSThread and running some code. In the same thread, I'm using NSURLConnection and trying to get some data from server. I implemented all the delegates related to connection. In the thread i also had the following code to wait for completion of getting data from server:
while (threadFinished == NO) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}
But its crashing immediate next line to above code. Its just saying EXC_BAD_ACCESS.
Can some one guide me infixing the issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论