gpt4 book ai didi

ios - 如何引用 UIAlertController 文本框中的输入文本?

转载 作者:行者123 更新时间:2023-11-29 01:25:24 26 4
gpt4 key购买 nike

我的警报 Controller 中有一个文本框,用户可以在其中输入他们希望将对象另存为的内容。我找不到引用用户输入的这个字符串的方法。

最佳答案

UIAlertController 有一个 textFields属性,它保留在警报 Controller 中使用的 UITextFields 数组。

Use this property to access the text fields displayed by the alert. The text fields are in the order in which you added them to the alert controller. This order also corresponds to the order in which they are displayed in the alert.

如果你只有一个UITextField,你可以使用[alertController.textFields firstObject].text来访问用户输入的文本。

关于ios - 如何引用 UIAlertController 文本框中的输入文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34075337/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com