开发者

Pausing the Current function for some time iphone

开发者 https://www.devze.com 2023-04-01 14:08 出处:网络
Hi all im trying to pause a function so some time in the middle of execution because ill have to wait for the call back fun开发者_运维知识库ctions from GData api and get my data ready to put in that f

Hi all im trying to pause a function so some time in the middle of execution because ill have to wait for the call back fun开发者_运维知识库ctions from GData api and get my data ready to put in that function i dont know how to do that. I am developing in Xcode 4.2 really need some help


You need to consider redesigning a little bit. What ever portion of code you expect to process after callback happens, let that code called by the callback. That way it will give you the guarantee that it always executes after the callback.


where you want to wait your functionality write this code [self performSelector:@selector(WaitForTwoSecond) withObject:nil afterDelay:2]; and implement - (void)WaitForTwoSecond { //write your code here } this method wait for two second and after that you cant access all data and put it in appropriate place .

we can say that this function is working like in background process

0

精彩评论

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

关注公众号