ios UITextChecker 无法将单词添加到字典中

标签 ios dictionary

我正在尝试通过 UITextChecker 在 iOS 词典中添加一个词 使用这个:

[UITextChecker learnWord:@"whatishouldadd"];

[UITextChecker hasLearnedWord::@"whatishouldadd"]<--return true

但是,当我启动笔记并键入上面的内容时,它带有红色下划线。

另一个例子: 我尝试使用上面的方法在字典中添加 happizer 。但是,当我发射音符时,会提示 happier

我可以知道函数 learnWord 是否真的将工作添加到字典中吗?

最佳答案

根据 UITextChecker 类引用,learnWord ...

"Tells the text checker to learn the specified word so that it is not evaluated as misspelled."

由于您是在应用程序内部创建 UITextChecker,因此是您的 UITextChecker 正在学习单词,而不是 iPhone 字典整个。因此,应用程序内部教授的单词将无法在全局范围内使用。

关于ios UITextChecker 无法将单词添加到字典中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13390782/

相关文章:

ios - 管理推送通知

ios - 如何停止覆盖数据

c++ - map 删除器在 C++ 中不起作用?

c - 使用 C 中的排序字典对字符串进行拼写检查

firebase - 从 firebase 数据库 flutter 读取项目列表

python - 递归函数,在字典中查找(x步)所有可能的路径

ios - 如何从 Swift 3 获取 MS Translator 访问 token ?

iOS 应用程序因 "function signature specialization <Arg[0] = Exploded, Arg[2] = Exploded>"而崩溃

android - 设备指纹识别(Android 和 iOS)

ios - AppDelegate中Viewcontroller的访问变量