cancel NSURLConnection in ios

后端 未结 2 692
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 19:59

I am calling webservice on mapView drag/regionChange. I want to keep some delay in the web service calls. So I want that whenever the user drags the map multipl

2条回答
  •  借酒劲吻你
    2020-12-21 20:39

    Don't use the sendAsynchronousRequest convenience API, use the main delegate API so you have access to the instance of NSURLConnecyion to call cancel on.

    Also, don't cancel operations on the main queue, you don't know what's there, and consider using NSURLSession

提交回复
热议问题