一,UIAlertView警告框
(1) UIAlertView * alert = [[UIAlertViewalloc]
initWithTitle:@"Notice"message:@"the alert"delegate:selfcancelButtonTitle:@"OK"otherButtonTitles:@"Options1",@"Options2",nil];
[alert show];
很简单,上述方法可以产生并显示一个警告框。警告框上的button的内容就是设置ButtonTitle。关键是警告框给提供的协议方法。(2)
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
这个方法是当用户点击警告框中的某个按键时会触发该方法,buttonIndex代表按钮的索引,从0开始
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
这个方法是完全隐藏警示框出来之后会触发
- (void)alertViewCancel:(UIAlertView *)alertView
这个是在警告框被取消时触发
- (void) alertView:(UIAlertView