Q:

make modally presentation from UISplitViewControllers primary view to detail view

I have a plus button in my primary view controller of a UISplitViewController and i want to present something modally in my detail view, just like apple does when adding a new contact in address book in iPad. I have tried everything but nothing. I managed to do it but when i am trying to embed my presented view controller into a UINavigation controller then my presented controller covers the full screen. Any suggestions? Here is my code:
UINavigationController *navController = [self.splitViewController.viewControllers lastObject];
    DetailTableViewController *controller = (DetailTableViewController *)navController.topViewController;
controller.definesPresentationContext = YES;
controller.providesPresentationContextTransitionStyle = YES;

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
EditTableViewController *etvc = (EditTableViewController *)[storyboard instantiateViewControllerWithIdentifier:@"EditTableViewController"];

UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:etvc];
etvc.patient = patient;

if (IDIOM == IPAD)
{

    etvc.modalPresentationStyle = UIModalPresentationCurrentContext;
    [controller presentViewController:nav animated:YES completion:nil];

} else {
    [self presentViewController:nav animated:YES completion:nil];
}

A:

I just successfully solved this problem by creating a custom segue whose implementation is:
- (void)perform
{
    UIViewController *ctrl = self.sourceViewController;
    UIViewController *dest = self.destinationViewController;

    dest.modalPresentationStyle = UIModalPresentationCurrentContext;
    [ctrl presentViewController:dest animated:YES completion:nil];
}

I'm seeing the behavior I want by invoking this segue from my detail view controller on the modal view I want to overlay it.
I think where your code is going haywire is here:
etvc.modalPresentationStyle = UIModalPresentationCurrentContext;

I think it should be:
nav.modalPresentationStyle = UIModalPresentationCurrentContext;

Though I haven't tested it.
Note that the Apple docs suggest that modalPresentationStyle is ignored on the iPhone (or on "horizontally compact devices"), so your "IS_IPAD" check may be redundant.
Hope this helps!

