- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"----touchesBegan"); static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ // NSLog(@"----once"); 只会打印一次 NSLog(@"----once"); }); }
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"----touchesBegan"); static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ // NSLog(@"----once"); 只会打印一次 NSLog(@"----once"); }); }