- (void)viewDidLoad {
[super viewDidLoad];
[self showAlert:@"呵呵"];
// Do any additional setup after loading the view, typically from a nib.
}
//时间
- (void)showAlert:(NSString *) _message{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"提示" message:_message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[NSTimer scheduledTimerWithTimeInterval:1.5f
target:self
selector:@selector(timerFireMethod:)
userInfo:alert
repeats:YES];
[alert show];
}
//弹出框
- (void)timerFireMethod:(NSTimer*)theTimer
{
UIAlertView *alert = (UIAlertView*)[theTimer userInfo];
[alert dismissWithClickedButtonIndex:0 animated:NO];
alert = NULL;
}