clickedbuttonAtindex diddismisswithbuttonIndex的区别

     刚刚开始ipad开发  UIAlertViewDelegate protocol 定义的  alertView:clickedButtonAtIndex:和 alertView:didDismissWithButtonIndex的区别很让人费解,摘录下一份答案留下记忆:

 

理论区别

 

The "alertView:clickedButtonAtIndex:" is called when the user clicks a button on an alert view whereas the "alertView:didDismissWithButtonIndex:" is called after an alert view is dismissed from the screen. (see theUIAlertViewDelegate Protocol Reference)

 

 

didDismissWithButtonIndex是在clickedButtonAtIndex 之后被调用

 

隐藏效果:

 

When showing a UIAlertView, and the device goes to sleep,alertView:didDismissWithButtonAtIndex: gets called, even though the alert view is not actually dismissed. It is shown again once the device wakes up. alertView:clickedButtonAtIndex: is only called when the user clicks one of the buttons.

 

嘿嘿 多个alertview 用settag 然后在事件中检测即可

你可能感兴趣的:(clickedbuttonAtindex diddismisswithbuttonIndex的区别)