如何使用线程在 iPhone 中实现自动完成文本字段
我有一个网址,每当用户在文本字段中输入单个字符时,我都必须点击该网址。每次提要发生变化时,我都必须将这些结果存储在一个数组中,并在自动完成文本字段中显示它。现在我在没有线程的情况下执行此操作,从提要中获取数据变得太慢。我知道它必须通过线程来实现,如果有人知道如何执行此操作,请发表您的观点。
I have one url which i have to hit every time whenever user enters single character in textfield.Everytime the feeds changes and i have to store those result in an array and show it in autocomplete textfield . Right now i am doing this without threading and it becomes too slow to fetch data from feed.I know it has to be implemented with threading if anyone know how to do this please post your view.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不必担心线程。
NSURLConnection
具有异步执行请求的方法。您只需给它一个委托或一个完成块,它就会在请求完成时调用您。You don't have to worry about threading.
NSURLConnection
has methods for performing the request asynchronously. You just give it a delegate or a completion block and it will call you when the request is complete.