开发者

iphone nsurlconnection async, wait for done

开发者 https://www.devze.com 2023-01-08 20:35 出处:网络
My code ha开发者_StackOverflow中文版s a function (F1) to return YES/NO based on information read from server. So it uses async nsurlconnection to receive data.

My code ha开发者_StackOverflow中文版s a function (F1) to return YES/NO based on information read from server. So it uses async nsurlconnection to receive data. So F1 starts connection and MUST wait for data to be loaded

The question is how can i implement it?

thanks


Don't. Find a way to use asynchronous calls. You must not pause the run loop while waiting for results; your application will be killed.

Instead, re-factor your code to return control to Cocoa and make the completion resume your processing.

I think WWDC Session #200 covers this.

0

精彩评论

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