iphone - 如何检查一个词是否在 cocoa touch 的英语词典中定义?

标签 iphone objective-c ios cocoa-touch

我正在尝试为 IOS 制作一个填字游戏应用程序,但我不知道如何检查字符串是否是有效的英文单词。

我如何检查它。 是否有任何 API 或在线工具来检查它。 提前致谢

最佳答案

在 iOS5 中使用 UIReferenceLibraryViewController 类的 +dictionaryHasDefinitionForTerm: 方法很容易做到。

A UIReferenceLibraryViewController object provides a dictionary service to look up the definition of terms. You create and initialize a reference library view controller using the initWithTerm: method. You pass the term to define as the parameter to this method and the definition is displayed. You can present this view controller modally or as part of another interface. On iPad, you can set the reference library view controller as the content view controller of a UIPopoverController object. Optionally, use the dictionaryHasDefinitionForTerm: class method to check if a definition is available for a given term before creating an instance—for example, use this method if you want to change the user interface depending on whether a definition is available.

关于iphone - 如何检查一个词是否在 cocoa touch 的英语词典中定义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8008458/

相关文章:

ios - 使用 NSFetchedResultsController 在空表上自定义单元格

ios - 为什么我在 iOS 上看不到导航后退按钮?

ios - 是否可以通过企业配置文件(内部企业)获得推送通知?

iphone - IOS 在 3 秒后淡出屏幕过渡

ios - 如何在 iphone sdk 中检查键数组是否为 Null 或为空?

ios - UIPopoverPresentationController 始终显示全屏模式弹出窗口

ios - Objective C 复制属性与复制消息

objective-c - 将 UIBarButtonItem 添加到 UINav..Controller

ios - 提交前的 Swift segue 自定义转换布局

iphone - 比较字符串 Objective C