UISplitViewController detail replace segue opens as modal?

299 views Asked by At

I have a UISplitViewController in my app with a master and a detailview. The detailview is just an empty UIViewController on launch. Once a user selects a UITableViewCell in the masterview I'd like to change the detailview to the chosen view. I wrote this function for that:

- (void)cellClicked:(NSIndexPath *)indexPath {
    if (indexPath.row == (self.resultArray.count)) {
        [self addCategory:self];
    } else {
        [self performSegueWithIdentifier:@"showDetail" sender:self];
    }
}

Also this prepareForSegue function:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([[segue identifier] isEqualToString:@"showDetail"]) {
        NSIndexPath *indexPath = self.tableView.indexPathForSelectedRow;
        NSString *categoryId = [[self.resultArray objectAtIndex:indexPath.row] objectForKey:@"COL2"];

        CategoriesViewController *controller = (CategoriesViewController *)[segue destinationViewController];
        [controller setFeedId:categoryId];
    }
}

However, when this is executed it opens the new view as a modal. Which is not what I wanted. What am I doing wrong here?

1

There are 1 answers

0
Beto On

Check in your storyboard segue type definition.enter image description here

I believe you have modally because assume you must use storyboard.