I have looked around on this and this error seems to get tacked on to completely different issues. Here is my code clip, tell me if you might need more. This is setting the size on the last cell of a table using using UITableView
.
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
int returnValue = 44;
int numRows = [tableView numberOfRowsInSection:[indexPath section]];
if (!([indexPath row] == numRows - 1)) {
returnValue = 60;
}
return returnValue;
}
I have commented out all of the lines on in the code to find that the [tableView numberOfRowsInSection:[indexPath section]]
throws up the error. Any ideas?
Edit: It looks like every time you call tableView it redraws all of the cells which calls this method which calls this method ad nauseum. I found this in the documentation for the method:
"Every time a table view is displayed, it calls tableView:heightForRowAtIndexPath:
on the delegate for each of its rows, which can result in a significant performance problem with table views having a large number of rows (approximately 1000 or more)."
Does this mean I can't call these methods?
Edit 2: Found my answer here