方法1:
- (void)highlightButton:(UIButton *)b {
[b setHighlighted:YES];
}
- (IBAction)onTouchup:(UIButton *)sender {
[self performSelector:@selector(highlightButton:) withObject:sender afterDelay:0.0];
}
方法2:
-(void)onTouchup:(UIButton*) button
{
[NSOperationQueue.mainQueue addOperationWithBlock:^{ button.highlighted = YES; }];
}
方法3:
dispatch_async(dispatch_get_main_queue(), ^{
[button setHighlighted:YES];
});