Tha*_*nks 0 iphone cocoa-touch uikit
从JavaScript我习惯创建一个间隔并指定重新调用函数的延迟,直到我停止间隔.iPhone上有类似的东西吗?任何好的链接都非常感谢.这适用于社区维基.
//create and start timer
[NSTimer scheduledTimerWithTimeInterval: 0.05 target: self selector: @selector(timerMethod:) userInfo: nil repeats: YES];
// method works 20 times per second
-(void) timerMethod: (NSTimer*)theTimer {
NSLog(@"timer is working");
}
Run Code Online (Sandbox Code Playgroud)