如何检查一个单词是否在可可触摸的英语字典中定义? [英] How to check if a word is defined in the English dictionary in cocoa-touch?

查看:77
本文介绍了如何检查一个单词是否在可可触摸的英语字典中定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to make a crossword app for IOS but i Don't know that how to check if a string is valid english word or not.

如何我检查它。
有任何API或在线设施来检查它。
感谢提前

How can i check it. Is there any API or online facility to check it. Thanks in Advance

推荐答案

使用 UIReferenceLibraryViewController class' + dictionaryHasDefinitionForTerm:方法。

Easy to do in iOS5 using the UIReferenceLibraryViewController class' +dictionaryHasDefinitionForTerm: method.


A UIReferenceLibraryViewController 对象提供了一个字典
服务来查找术语的定义。您可以使用 initWithTerm:方法创建并初始化
参考库视图控制器。
您传递该术语以定义为此方法的参数,并显示
定义。您可以将此视图控制器模块化为
或作为另一个接口的一部分。在iPad上,您可以将引用
库视图控制器设置为
UIPopoverController对象的内容视图控制器。或者,在创建实例之前,使用
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.

这篇关于如何检查一个单词是否在可可触摸的英语字典中定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆