You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用UITextField的becomeFirstResponder()时出现RTIInputSystemClient相关错误的求助

调用UITextField的becomeFirstResponder()时出现RTIInputSystemClient相关错误的求助

我在给UITextField调用becomeFirstResponder()时遇到了这个错误:

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = , customInfoType = UIEmojiSearchOperations

我最初是用这段代码创建文本框的:

textField = UITextField(frame: CGRect(origin: .zero, size:frame.size))
textField.text = ""
textField.backgroundColor = UIColor.clear
textField.layer.borderWidth = 0
textField.layer.borderColor = UIColor.clear.cgColor
textField.layer.backgroundColor = UIColor.clear.cgColor

第一次调用textField.becomeFirstResponder()是正常工作的,但当我点击文本框外部让它失去焦点后,就会弹出上面的错误;之后再点击文本框尝试让它成为第一响应者时,也会出现完全一样的错误。

我已经按照类似帖子的建议关闭了自动校正,但完全没用。我还试过把文本框从父视图中移除……

备注:内容来源于stack exchange,提问作者April G

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 08:54:35