Mantas
Mantas

Reputation: 5951

Autocorrect NSString on iPhone

Basically what I want to do is to use Cocoa's autocorrection feature on NSString.

E.g. [string autocorrect] would return what it text field shows in a popup

Is it possible?

Upvotes: 2

Views: 567

Answers (2)

Rugen Heidbuchel
Rugen Heidbuchel

Reputation: 387

This is a very old post, but now you can use UITextChecker to do this. There's a nice post about it on NSHipster: http://nshipster.com/uitextchecker/

Upvotes: 0

Matt S.
Matt S.

Reputation: 13753

As far as I know you can't, besides, why would you want it? If you want to auto correct a string then it would have to be inputted from somewhere, either by you or by the user. If it's by you then just run spell check before you input it in your code. If the user inputs it, just enable it in the text field using something like:

    textfield.autocorrectionType = UITextAutocorrectionTypeYes; 

Upvotes: 3

Related Questions