gpt4 book ai didi

objective-c - 如何关闭segue ios8

转载 作者:搜寻专家 更新时间:2023-10-30 20:16:10 25 4
gpt4 key购买 nike

我对 segue 不是很熟悉。我是第一次使用它。

[self performSegueWithIdentifier:@"LoginSegue" sender:nil];

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
id destinationViewController = segue.destinationViewController;

if ([destinationViewController isKindOfClass:[MFSideMenuContainerViewController class]])
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:Main bundle:[NSBundle mainBundle]];

UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:NavigationController];
MFSideMenuContainerViewController *container = (MFSideMenuContainerViewController *)destinationViewController;
UIViewController *leftSideMenuViewController = [storyboard instantiateViewControllerWithIdentifier:LeftSideMenuIdentifier];

[container setLeftMenuViewController:leftSideMenuViewController];
[container setCenterViewController:navigationController];
}
}

我的问题是当我试图使用以下方法在 SideMenu 中的注销按钮上关闭它时,

 [self dismissViewControllerAnimated:YES completion:nil];

什么都没有发生。不知道如何拒绝它。任何人都可以解决这个问题吗?提前致谢!

最佳答案

根据documentation dismissViewControllerAnimated

Dismisses the view controller that was presented modally by the receiver.

所以这适用于模态呈现的 Controller ,对于导航堆栈,使用 unwind segues相反。

关于objective-c - 如何关闭segue ios8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30123649/

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