- (void)timerFireMethod:(NSTimer*)theTimer//弹出框
{
UIAlertView *promptAlert = (UIAlertView*)[theTimer userInfo];
[promptAlert dismissWithClickedButton
Index:0 animated:YES];
promptAlert =NULL;
}
- (void)showAlert:(NSString *) _message{//时间
UIAlertView *promptAlert = [[UIAlertView alloc] initWithTitle:@"提示:" message:_message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[NSTimer scheduledTimerWithTimeIn
terval:1.5f
target:self
selector:@selector(timerFireMethod:)
userInfo:promptAlert
repeats:YES];
[promptAlert show];
}
个人观点: 效果有点尴尬, 但是可以根据其他方法去自定义AlertView;
转自: http://blog.sina.com.cn/s/blog_721cd3390101voi2.html