- (void)showAlert{
UIAlertView *alert = [[UIAlertViewalloc]initWithTitle:@"提示"message:@"2秒后将消失"delegate:nil cancelButtonTitle:nilotherButtonTitles:nil];
[alertshow];
// 2秒后执行
dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, 2*NSEC_PER_SEC);
dispatch_after(time, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[alert dismissWithClickedButtonIndex:[alert cancelButtonIndex] animated:YES];
});
}