Here is the code I\'m using:
if (appDelegate.currentMainIndexPath != nil /* && doesPathExistInTableView */)
{
[tblView scrollToRowAtIndexPath:appDele
There is a more convenient method to tell if a indexPath is valid:
For Swift 3.0:
open func rectForRow(at indexPath: IndexPath) -> CGRect
For Objective-C
- (CGRect)rectForRowAtIndexPath:(NSIndexPath *)indexPath;
You will get CGRectZero if the indexPath is invalid.
func isIndexPathValid(indexPath: IndexPath) -> Bool {
return !tableView.rectForRow(at: indexPath).equalTo(CGRect.zero)
}