IOS UIAlertView点击确定按钮不消失

怎样才能让UIAlertView只有一个确定按钮的情况下,点击确定 不让其消失

调用UIAlertView的代理方法,alertView clickedButtonAtIndex:(NSInteger)buttonIndex 判断buttonIndex == 0的时候,再执行一遍上面的UIAlertView 哈哈

iOS7之后就用UIAlertController吧

这个类里面遵循一个协议 给你的alertview设置一个代理alerView.delegate= self;,实现他的代理方法

  • (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ if (buttonIndex == 0) { //做你想做的事 } }