关闭

clickedbuttonAtindex diddismisswithbuttonIndex的区别

标签: referencebuttonuseripad
2881人阅读 评论(0) 收藏 举报

     刚刚开始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 然后在事件中检测即可

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:316236次
    • 积分:4150
    • 等级:
    • 排名:第7395名
    • 原创:50篇
    • 转载:203篇
    • 译文:0篇
    • 评论:77条
    最新评论
    自己收藏的网站