开发者

How to make a function wait 30 seconds before it starts?

sorry still a newbie in the programming. Basically I have an Uibutton, when that button is pressed it would switch to another view, when it switches to that view, a function which calls a telephone number and sends an SMS text message out starts. What I'm trying to do it make that funct开发者_运维问答ion wait 30seconds before it starts.

Any idea how to do this please?


just use: -performSelector:withObject:afterDelay:


YOu can use NSTimer for that.

NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:30.0 target:self selector:@selector(myTimerMethod:) userInfo:nil repeats:NO];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜