michaeltyson / TPKeyboardAvoiding

A drop-in universal solution for moving text fields out of the way of the keyboard in iOS
http://atastypixel.com/blog/a-drop-in-universal-solution-for-moving-text-fields-out-of-the-way-of-the-keyboard/
zlib License
5.81k stars 925 forks source link

TPKeyboardAvoidingTable Cause a crash #234

Open loupman opened 7 years ago

loupman commented 7 years ago

Here is repeat steps: ControllerA use TPKeyboardAvoidingTable to display data, then select one item to push ControllerB. and ControllerB also use TPKeyboardAvoidingTable to display data. but when click the UITextView on one cell in ControllerB. at this time APP will cause a crash says : "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView (<TPKeyboardAvoidingTableView: 0x7fd59387bc00; baseClass = UITableView; frame = (0 0; 320 459); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600000255270>; layer = <CALayer: 0x600000222520>; contentOffset: {0, 0}; contentSize: {320, 1782.0000038295984}>) failed to obtain a cell from its dataSource (<ControllerA: 0x7fd591c4cbe0>)"

Test environment: iOS 10.0 Simulator iPhone se

phoney commented 6 years ago

This assertion failure means that your cellForRowAtIndexPath method returned nil in ControllerA.