I have simple UITableView for youtube movies. Cells are loading from array and when I fetch first 10 movies from youtube API last cell is 'load more' cell. When user tap on 'load more' cell it will fetch and load next 10 movies. Everything is fine except when I will tap very quick twice or more times on 'load cell' before it will refresh my table with new array, than I am having strange behaviour (all cells with movies disappearing and I have a lot 'load more' cells spread within table rows)so my table is totally messed up. Problem doesn't exist if I'am tapping 'load more' cell gently with only one tap.
I have set userInteractionEnabled to NO after my cell is tapped but it didn't help. Can someone tell me what I am doing wrong? Here is my code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//Load more json data if loadmore cell tapped
if (indexPath.row == self.videos.count) {
self.loadCell.userInteractionEnabled = NO;
self.loadCell.title.text = @"loading...";
//Activity indicators for loadmore cell
[self.loadCell.loadMoreActivityIndicator startAnimating];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
[self performSelectorInBackground:@selector(youtubeFeedMore) withObject:nil];
}
}