我认为您正在从 masterViewController 推送 DetailViewController。但是您的 masterviewController 应该实现 NavigationController,我的意思是在弹出窗口中显示 masterViewController(your tableviewcontroller) 时,您应该执行以下操作:
MasterViewController *theMasterViewController = [[MasterViewController alloc] init];
UINavigationController *navCont = [[UINavigationController alloc] initWithRootViewController:theMasterViewController];
[theMasterViewController release];
UIPopoverController *popOverController = [[UIPopoverController alloc] initWithContentViewController:navCont];
popOverController.popoverContentSize = CGSizeMake(400, 400);
[popOverController presentPopoverFromRect:btn.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
当用户选择任何行时,在 didSelectRowAtIndexPath 中执行以下操作:
DetailViewController *detailViewController = [[DetailViewController alloc] init];
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
希望这可以帮助!