prepareForSegue getting called twice, with Attempt to present <UINavigationController> while presentation is in progress

The problem is prepareForSegue is called before didSelectRowAtIndexPath. You should just eliminate the didSelectRowAtIndexPath method, and do everything in prepareForSegue. You can use the following line to get the indexPath you need:

NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];

Rob's answer helped me, as well - thanks! I'm coding in Swift, so for those who run into this while Swifting, here's how to get the index (or index row) clicked on in Swift 3:

var rowClicked = (self.tableView.indexPathForSelectedRow?.row)!