FIXED: crash when a cell based table view contains a dataview that contains an editable text field

Previously, CPTableView was listening to all end editing notifications in cell-based mode.
This caused a crash if the textfield is an actually subview of a dataview.

This patch ensures to listen only editing did end notification for direct subview of tableView.
This commit is contained in:
Antoine Mercadal committed 2015-08-03 15:00:04 -07:00
1 parent 7c17d5bac0
commit 6420a51dd0
1 file changed
+1 -1
+1 -1
View File
@@ -5199,7 +5199,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
[self _notifyViewDidBecomeFirstResponder];
// This is for cell-based tables only. In view-based mode, we do not change the textfield apprearence during an edit.
if (!_isViewBased && _editingRow !== CPNotFound && [responder isKindOfClass:[CPTextField class]] && [responder isEditable])
if (!_isViewBased && _editingRow !== CPNotFound && [responder isKindOfClass:[CPTextField class]] && [responder isEditable] && [responder superview] == self)
{
[responder setBezeled:YES];
[self _registerForEndEditingNote:responder];