0

From JavaScript I am used to create an interval and specify the delay for re-calling the function, until I stop the interval. Is there something similar available on the iPhone? Any good links are highly appreciated. This goes to community wiki.

4

1 回答 1

5
//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");
}
于 2009-05-07T13:17:55.260 回答