开发者

ASIHTTPRequest multiple Async request issue

开发者 https://www.devze.com 2023-04-06 08:25 出处:网络
When I put an asynchronous ASIHTTPRequest to work, called Request1, when it finishes it calls the - (void)requestFin开发者_开发问答ished:(ASIFormDataRequest *)request2 which is the wrong thread. How d

When I put an asynchronous ASIHTTPRequest to work, called Request1, when it finishes it calls the - (void)requestFin开发者_开发问答ished:(ASIFormDataRequest *)request2 which is the wrong thread. How does that happen, and more importantly, how do i avoid it?


ASIHTTPRequest should always call it's request finished / error methods on the main thread.

If you want to then go back into another thread then it's up to you to do that (i.e. performSelectorInBackground:, NSOperationQueue etc).

0

精彩评论

暂无评论...
验证码 换一张
取 消