views:

413

answers:

3

Is there a way to retrieve words randomly from the built in Dictionary through the SDK?

I can provide my own list of words but using the built in Dictionary allows for easy localization.

+1  A: 

No access is provided to the Spell Checker.

John Fricker
+3  A: 

Unfortunately this is one of the areas of the iPhone that applications have no access to.

However there are a number of free dictionaries available that you could use as an alternative. It's easy enough to convert a text-based file into ansqlite database which then makes it super easy to pick words at random.

And yes, as you point out localization is a problem with this :(

Andrew Grant
A: 

The iPhone checks for spelling in UITextField objects. Create a UITextField as a user input area. Declare your interface to conform to the protocol. Add any other delegates and then utilize UITextChecker

It has stuff like availableLanguages, hasLearnedWord, learnWord, unlearnWord It also has guessesForWordRange:inString:language that returns a list of words that are possible valid replacements for a misspelled word.

For more information check out the iPhone OS Reference Library on UITextChecker http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITextChecker_Class/Reference/Reference.html

DougPan

Douglas Michael