setAutocorrectionType:它默认就是yes,可以禁掉(即设为NO)。
不仅SearchBar、TextField、UITextView,都可用到此Method.
[searchBar setAutocorrectionType:UITextAutocorrectionTypeNo];
[textField setAutocorrectionType:UITextAutocorrectionTypeNo];
[textView setAutocorrectionType:UITextAutocorrectionTypeNo];
@property(nonatomic) UITextAutocorrectionType autocorrectionType; // default is UITextAutocorrectionTypeDefault
typedef NS_ENUM(NSInteger, UITextAutocorrectionType) {
UITextAutocorrectionTypeDefault,
UITextAutocorrectionTypeNo,
UITextAutocorrectionTypeYes,
};