Timer Timer
To design a timing timer:
1, create variable array, hold 0~100 number
2, create a 0~100 number with a for loop and put it in a mutable array
3, create timer: Create timer: Parameter 1: Set time interval, parameter 2: target, Parameter 3: Timer binding method, Parameter 4: supplementary information, general null; parameter 5: Repeat
_timer = [nstimerscheduledtimerwithtimeinterval:0.1target:self selector: @selector (outPut) UserInfo:nilrepeats:YES] ;
4, Timer Stop method: If statement to determine whether the timer is empty
if (_timer! = nil)
5, read data method: Create static variable, use index to read data
static int count = 0;
NSString * str =[_array objectatindex:count];
NSLog (@ "-----%@", str);
Count + +;
6, prevent array from overstepping
if (count>99) {
count=0;
}
7, Timer destruction
[_timer invalidate];
iOS Development--animation---Chronograph timer