-2

My textfield name is searchtextfeild. When I type anything, it autosuggests as in the given picture.

enter image description here

Now, I simply do not want to show this autosuggest. I want to disable it.

I tried,

searchtextfeild.autoautocorrectionType = FALSE;

Strange thing is though searchtextfeild is textfield, it does not have property autoautocorrectionType. Anyway, how can I disable this autosuggest?

Daniel Darabos
  • 26,991
  • 10
  • 102
  • 114
Lasang
  • 1,369
  • 6
  • 24
  • 44
  • 2
    possible duplicate of [How to programmatically turn off Auto Correction in iphone sdk?](http://stackoverflow.com/questions/11789594/how-to-programmatically-turn-off-auto-correction-in-iphone-sdk) – Greg Oct 07 '14 at 12:19
  • Actually I found solution. My searchfeild was using library. And autocorrectiontype works – Lasang Oct 07 '14 at 12:21
  • how can i remove this question ? – Lasang Oct 08 '14 at 04:32
  • There should be a delete button just below the question tags (objective-c and ios7) – Greg Oct 08 '14 at 04:57

2 Answers2

1

Check this please:

searchtextfeild.autocorrectionType = TRUE;

For some strange reason it works for me.

hoya21
  • 893
  • 7
  • 24
1

autocorrectionType property has type UITextAutocorrectionType which is enum:

typedef NS_ENUM(NSInteger, UITextAutocorrectionType) {
    UITextAutocorrectionTypeDefault,
    UITextAutocorrectionTypeNo,
    UITextAutocorrectionTypeYes,
};

So you just need to do

searchtextfeild.autocorrectionType = UITextAutocorrectionTypeNo;
hybridcattt
  • 3,001
  • 20
  • 37