I have a UITabBarController template based app where the first tab is a UITableViewController with custom buttons in the cells. I need one button in one cell to call a specific tab in the parent UITabBarController. Im using this code in the didSelectRowAtIndexPath:
case 5:
            NSLog(@"Search");
            [tableView deselectRowAtIndexPath:indexPath animated:YES];
            // Get UITabBar instance and send it message
            UITabBarController *tabBar = (UITabBarController*)[self parentViewController];
            [tabBar setSelectedIndex:1];
            break;
When I tap on this row the app crashes without any log in the console. Im calling this in that UITableViewController which is the first tab in the UITabBarController.
PS I also want to avoid the blue selection on this cell that occurs when the user taps. So I added this code:
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.row) {
        case 1:
            return nil;
            break;
    }
}
But it still selects blue when I tap on it. Could they be related issues?
 
    