My UITableView won't scroll down through the end of the data! Why?
Decrease your tableView's height.
I know it's an old question and this is not an answer to your question, but a suggestion to improve your code so others can benefit.
You could write this:
if (indexPath.row >= 4 && indexPath.row <= 8) { // 4 and 8 inclusive
cell.indentationLevel = 2;
}
cell.textLabel.text = @"";
Instead of this:
if(indexPath.row == 0){
cell.textLabel.text = @"";
}else if(indexPath.row == 1){
cell.textLabel.text = @"";
}else if(indexPath.row == 2){
cell.textLabel.text = @"";
}else if(indexPath.row == 3){
cell.textLabel.text = @"";
}else if(indexPath.row == 4){
cell.indentationLevel = 2;
cell.textLabel.text = @"";
}else if(indexPath.row == 5){
cell.indentationLevel = 2;
cell.textLabel.text = @"";
}else if(indexPath.row == 6){
cell.indentationLevel = 2;
cell.textLabel.text = @"";
}else if(indexPath.row == 7){
cell.indentationLevel = 2;
cell.textLabel.text = @"";
}else if(indexPath.row == 8){
cell.indentationLevel = 2;
cell.textLabel.text = @"";
}else if(indexPath.row == 9){
cell.textLabel.text = @"";
}else if(indexPath.row == 10){
cell.textLabel.text = @"";
}else if(indexPath.row == 11){
cell.textLabel.text = @"";
}else if(indexPath.row == 12){
cell.textLabel.text = @"";
}else if(indexPath.row == 13){
cell.textLabel.text = @"";
}else if(indexPath.row == 14){
cell.textLabel.text = @"";
}else if(indexPath.row == 15){
cell.textLabel.text = @"";
}else if(indexPath.row == 16){
cell.textLabel.text = @"";
}else if(indexPath.row == 17){
cell.textLabel.text = @"";
}else if(indexPath.row == 18){
cell.textLabel.text = @"";
}
And if you happen to have different text for each case you could either use:
switch (indexPath.row) {
case 0:
cell.textLabel.text = @"";
break;
...
case 18:
cell.textLabel.text = @"";
default:
break;
}
Or even better to put everything inside an NSArray
(database...) and just loop through them by the index.
This helped me:
[self.tableView setContentInset:UIEdgeInsetsMake(0,0,65,0)];