开发者

Will timerWithTimeInterval:target:selector:userInfo:repeats: fire immediately or will it fire first time after the specified time interval?

The documentation says about timerWithTimeInterval:target:selector:userInfo:repeats:

Returns a n开发者_如何学Cew NSTimer that, when added to a run loop, will fire after a specified number of seconds.

I don't fully understand this. Maybe someone can tell if it fires immediately or if the first time the selector gets called would be after the specified time interval (i.e. 10 seconds)?


It will fire in the given timeInterval, so not immediately. And when you set repeats to NO, it will not fire itself again, otherwise, it will send the first message after timeInterval seconds, then every timeInterval seconds.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜