http://iphonedevelopment.blogspot.com/2009/02/alert-view-with-prompt.html为什么不dismissWithClickedButtonIndex曾经调用clickedButtonAtIndex?
我使用的代码让我的iPhone应用程序,以显示与包括的UITextField的alertView和匹配取消和OK按钮。
用户可以输入文本,点击取消或确定...我看到用户输入的文本...在clickedButtonAtIndex方法中使用我的代码。
除了一件事情之外,它都可以工作:用户可能会在键盘上点击完成,而不是确定。 我使用dismissWithClickedButtonIndex模拟一个确定点击...但是然后clickedButtonAtIndex永远不会被调用。
不应该dismissWithClickedButtonIndex还调用clickedButtonAtIndex?
我试图让clickedButtonAtIndex被调用,如果取消,或确定,甚至完成击中。
谢谢你这些线条,古怪的委托模式,dismissWithClickedButton应该至少调用两个委托方法来处理按钮点击和另一个来处理关闭警报。令人困惑,多余的不必要的复杂性 – 2014-08-29 10:47:27