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.
精彩评论