Since starting to compile my app with iOS 6 (and since also iOS 7) I\'ve started seeing this message. I know that the way that UITableViews go about managing cells is diffe
Addition to the accepted answer (mluisbrown), I needed to add an autoresizingMask to the header cell, since mine contained a multi-line label, i.e.
UIView *view = [[UIView alloc] initWithFrame:[cell frame]];
cell.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[view addSubview:cell];
return view;
Well, I just used the better part of a day trying to figure this out, so hopefully this alternative explanation saves somebody else some time.
I had a tableview which was giving this message sometimes, when loading. It turned out to be caused by KVO notifications for Core Data objects firing while the view was loading. (On observing a change, my controller tried called reloadData on the tableview in question. Fixed by not observing the objects until the view had finished loading (previously I started observing the object once it was assigned via the accessor)
TLDR: Check to see if you might be trying to reload your data from something other than the main thread.
I had the same problem with the error message appearing. As far as I can see it is caused by reloading the table view from a function called by the the textfield as part of its delegate protocol. Ie textFieldDidEndEditing -> [controller.tableview reload...]
Yet another condition...
This happened when, not wanting a header, I returned nil
.
Fix:
func tableView(tableView: UITableView,
titleForHeaderInSection section: Int) -> String? {
return ""
}
I had the same problem and it took me few hours to hunt down the issue. Turns out I was calling [textField becomeFirstResponder]
while setting up cells (here the textField was part of a custom tableviewcell); [textField becomeFirstResponder]
in turns posts keyboardWillShow notification which in turn caused the tableview to prematurely load itself thus causing the infamous "no index path for table cell being reused” message. Once I removed that call, problem disappeared.
This is an internal UIKit bug - as mentioned in Apple's own dev forums. It's supposedly fixed in newer versions of xcode, although I wasn't able to find info regarding which version fixes this.