1. 定时器引发的思考
AudioServicesPlaySystemSoundWithCompletion(sysSoundID, ^{
AudioServicesDisposeSystemSoundID(sysSoundID);
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(lefexTimerAction:) userInfo:nil repeats:YES];
});
- (void)lefexTimerAction:(NSTimer*)timer
{
// 这个方法并不会执行
}AudioServicesPlaySystemSoundWithCompletion(sysSoundID, ^{
AudioServicesDisposeSystemSoundID(sysSoundID);
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(handlePageStayTimer:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] run];
});Last updated
Was this helpful?