gpt4 book ai didi

ios - prepareForSegue 从未调用过

转载 作者:行者123 更新时间:2023-11-28 22:30:50 26 4
gpt4 key购买 nike

我正在使用 SWRevealViewController 构建侧边栏菜单。从菜单(UITableView)中选择一个元素时,我有选择正确 Controller 的方法。 segue 标识符/名称在 Storyboard中配置。

- (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender
{
NSLog(@"Tapped");
// Set the title of navigation bar by using the menu items
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
UINavigationController *destViewController = (UINavigationController*)segue.destinationViewController;
destViewController.title = [[_menuItems objectAtIndex:indexPath.row] capitalizedString];

// Set the photo if it navigates to the PhotoView
if ([segue.identifier isEqualToString:@"showToday"]) {
[segue destinationViewController];

}
if ([segue.identifier isEqualToString:@"showCountries"]) {
[segue destinationViewController];

}


if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {
SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;

swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {

UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
[navController setViewControllers: @[dvc] animated: NO ];
[self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
};

}

}

但是从侧栏菜单中选择项目时没有任何反应。可能是什么问题?谢谢您的帮助。

最佳答案

我的错是选择“附件操作”而不是“选择继续”“显示 View Controller ”。

关于ios - prepareForSegue 从未调用过,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17506882/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com