IOS消息框,定时关闭
+(void)SHowMsg
{
NSString *strMsg = [NSString stringWithFormat:@"消息"];
lertView alloc] initWithTitle:@"提示" message:strMsg delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
//设置时间间隔
float time = 2.0f;
[NSTimer scheduledTimerWithTimeInterval:timetarget:self
selector:@selector(timerFireMethod:)
userInfo:alert
repeats:YES];
[alert show];
}
+(void)timerFireMethod:(NSTimer*)theTimer//弹出框
{
UIAlertView *alert= (UIAlertView*)[theTimer userInfo];
[alertdismissWithClickedButtonIndex:0 animated:NO];
alert= NULL;
}