nstimer,需要注册到 runloop里面去的,

创建Timer的三种方法

1.scheduling a timer with the current run loop 

2.creating a timer that you later register with a run loop

3.initializing a timer with a given fire date

 

 

Scheduled Timers

以下两个方法自动注册新创建的timer到当前NSRunLoop对象,NSRunLoop的模式为默认的NSDefaultRunLoopMode

  • + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds invocation:(NSInvocation *)invocation repeats:(BOOL)repeats
  • + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats
posted @ 2014-01-14 10:58  路在脚下,  阅读(216)  评论(0编辑  收藏  举报