MLPAutoCompleteTextField
MLPAutoCompleteTextField copied to clipboard
UIViewControllerHierarchyInconsistency exception when toggling autoCompleteTableAppearsAsKeyboardAccessory
When changing the autoCompleteTableAppearsAsKeyboardAccessory property to YES, then later to NO, I get the following exception :
'UIViewControllerHierarchyInconsistency', reason: 'child view controller:UICompatibilityInputViewController@dd063de0 should have parent view controller:(null) but actual parent is:UIInputWindowController@db090000'
With the following stack :
0 CoreFoundation 0x0000000114840d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001142b4deb objc_exception_throw + 48
2 CoreFoundation 0x0000000114840cbd +[NSException raise:format:] + 205
3 UIKit 0x00000001115bdc94 -[UIView(Hierarchy) _associatedViewControllerForwardsAppearanceCallbacks:performHierarchyCheck:isRoot:] + 507
4 UIKit 0x00000001115be0f0 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 276
5 UIKit 0x00000001115ccc9e -[UIView(Internal) _addSubview:positioned:relativeTo:] + 481
6 Test_IOS_1.0.0_en_fr 0x000000010fbafe82 -[MLPAutoCompleteTextField expandDropDownAutoCompleteTableForNumberOfRows:] + 754
7 Test_IOS_1.0.0_en_fr 0x000000010fbafaaf -[MLPAutoCompleteTextField expandAutoCompleteTableViewForNumberOfRows:] + 399
8 Test_IOS_1.0.0_en_fr 0x000000010fbadcb3 -[MLPAutoCompleteTextField tableView:numberOfRowsInSection:] + 147
9 UIKit 0x0000000111877a47 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 2787
10 UIKit 0x000000011187df21 -[UITableViewRowData rectForFooterInSection:heightCanBeGuessed:] + 391
11 UIKit 0x000000011187e06e -[UITableViewRowData heightForTable] + 62
12 UIKit 0x0000000111640153 -[UITableView _updateContentSize] + 374
13 UIKit 0x0000000111663ebe -[UITableView _rectChangedWithNewSize:oldSize:] + 1055
14 UIKit 0x0000000111664638 -[UITableView setFrame:] + 338
15 Test_IOS_1.0.0_en_fr 0x000000010fbb13d8 -[MLPAutoCompleteTextField resetDropDownAutoCompleteTableFrameForNumberOfRows:] + 264
16 Test_IOS_1.0.0_en_fr 0x000000010fbafbdd -[MLPAutoCompleteTextField expandDropDownAutoCompleteTableForNumberOfRows:] + 77
17 Test_IOS_1.0.0_en_fr 0x000000010fbafaaf -[MLPAutoCompleteTextField expandAutoCompleteTableViewForNumberOfRows:] + 399
18 Test_IOS_1.0.0_en_fr 0x000000010fbadcb3 -[MLPAutoCompleteTextField tableView:numberOfRowsInSection:] + 147
19 UIKit 0x0000000111877a47 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 2787
20 UIKit 0x000000011187befe -[UITableViewRowData numberOfRows] + 97
21 UIKit 0x0000000111658d3b -[UITableView noteNumberOfRowsChanged] + 134
22 UIKit 0x0000000111658385 -[UITableView reloadData] + 2104
23 Test_IOS_1.0.0_en_fr 0x000000010fbaf42f -[MLPAutoCompleteTextField autoCompleteTermsDidSort:] + 111
24 Foundation
I know this is not a very common use case, but I would like at least a workaround. I tried to call [self.autoCompleteTableView removeFromSuperview]; in several places, with no success. Anyone has a clue ?