Async call in Objective-C

前端 未结 4 523
说谎
说谎 2020-12-23 23:57

I\'m trying to get data from a website- xml. Everything works fine.

But the UIButton remains pressed until the xml data is returned and thus if theres a problem with

4条回答
  •  爱一瞬间的悲伤
    2020-12-24 00:03

    Use NSURLConnection's connectionWithRequest:delegate: method. This will cause the specified request to be sent asynchronously. The delegate should respond to connection:didReceiveResponse: and will be sent that message once the response is completely received.

提交回复
热议问题