【发布时间】:2010-12-17 16:55:34
【问题描述】:
http://iphonedevelopment.blogspot.com/2009/02/alert-view-with-prompt.html
我正在使用该代码让我的 iPhone 应用程序显示一个包含 UITextField 和匹配的 CANCEL 和 OK 按钮的 alertView。
用户可以输入文本,点击 CANCEL 或 OK...,我会看到用户输入的文本...使用 clickedButtonAtIndex 方法中的代码。
这一切都有效,除了 1 件事:用户可能会在键盘上点击 DONE,而不是 OK。 我正在使用dismissWithClickedButtonIndex 来模拟OK 点击......但随后clickedButtonAtIndex 永远不会被调用。
dismissWithClickedButtonIndex 不应该也调用 clickedButtonAtIndex 吗?
我试图让 clickedButtonAtIndex 在 CANCEL、OK 或什至 DONE 被点击时被调用。
【问题讨论】:
标签: uitextfield uialertview iphone