gpt4 book ai didi

iphone - 如何检查它是从哪个 View Controller 导航的....在obj c中

转载 作者:行者123 更新时间:2023-11-29 13:27:39 24 4
gpt4 key购买 nike

我所处的上下文中,我从大约 3 个类导航到一个类,比如 classX,我在 classX 上有一个后退按钮,单击该后退按钮我需要导航到它从中导航到的类,所以我需要检查它是从哪个 View Controller 导航的,是否可以不使用 UINavigationController

最佳答案

您将通过以下方式检查呈现 View Controller 的类型是否是您期望的类型:

if ([self.navigationController.presentingViewController isKindOfClass:[ParentController class]]) {
...
}

关于iphone - 如何检查它是从哪个 View Controller 导航的....在obj c中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12703636/

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