Can anybody duplicate this result? I\'m testing rangeOfMisspelledWordInString
(in iOS
) to find mispelled words and some random letters return a va
Yes, I can reproduce it, and I would call this a bug. If I put in your test word, @"lhpcjeuw", it treats it as a valid word. But, if I use @"lahpcjeuw" (added an "a" in second position), it catches it. I noticed the same thing Tim did -- when writing this answer, the spell checker underlined that second one but not the first as I typed.
I think "the" and "thy" just might be valid words ;)
Other than that, my best guess is that the text system can't provide a guess for the word, and so ignores it entirely - the semantic meaning of "misspelled word" might not include "strings of letters which cannot conceivably be a misspelling of a word." I notice that when I type those strings into a system text field (e.g. in Messages), I don't get any replacement suggestions.
You could also make sure that your UITextChecker instance isn't set to ignore those particular words; take a look at the ignoredWords property.