EddyBorja / MLPAutoCompleteTextField

UITextfield subclass with autocomplete menu. For iOS.
Other
1.21k stars 222 forks source link

fixed issue with not yet set autoCompleteDelegate used in the initialiser #73

Closed csknns closed 8 years ago

csknns commented 9 years ago

The IBOutlet autoCompleteDelegate is accessed from the initializer (init-> initialize-> styleAutoCompleteTableForBorderStyle:), but the outlets are not set while the designated initializer chain is called, so following delegate method will never get called while the class is initializing

- (BOOL)autoCompleteTextField:(MLPAutoCompleteTextField *)textField
    shouldStyleAutoCompleteTableView:(UITableView *)autoCompleteTableView
                      forBorderStyle:(UITextBorderStyle)borderStyle;

I moved the call to the styleAutoCompleteTableForBorderStyle: in the awakeFromNib method, where the outlets are set.