iOS 提示框,UIAlertView

IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)

UIAlertView的自动消失,手动消失和自定制消失

-(void) performDismiss:(NSTimer *)timer  
{  
[Alert dismissWithClickedButtonIndex:0 animated:NO];  
[Alert release];  
}  
  
-(void)presentAlert  
{  
Alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"出错啦!" delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];  
  
[NSTimer scheduledTimerWithTimeInterval:2.0f target:self selector:@selector(performDismiss:) userInfo:nil repeats:NO];  
[Alert show];  
}  

  

原文地址:https://www.cnblogs.com/dqxu/p/5121386.html