Http://blog.csdn.net/davidsph/article/details/7899731
If (! _ Timer ){
// Create a timer, which is directly added to the current message loop. Note the difference with other initialization methods.
}
If (_ timer ){
NSLog (@ "calling self. time is true !! ");
If ([self. timer isValid]) {
[Self. timer invalidate];
}
}
}
Creating a Timer
+ TimerWithTimeInterval: target: selector: userInfo: repeats:
-Fire
-IsValid // whether the task is running
-FireDate // Returns the date at which the specified er will fire.
-SetFireDate: // reset the timer Start Time
-TimeInterval // timer delay time
-UserInfo // Other information
Nsunloop * runloop = [nsunloop currentRunLoop];
[Runloop addTimer: _ timer forMode: NSDefaultRunLoopMode];
Self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil];
If (self ){
// Custom initialization
_ Timer = [nst1_timerwithtimeinterval: 10 target: self selector: @ selector (changeTimeAtTimedisplay) userInfo: nil repeats: YES];
// Simply call this method to see what the function is.
[_ Timer fire];