【发布时间】:2020-03-19 20:24:08
【问题描述】:
如果我在 IOS 内运行,不 swift,
[[navigationController popViewControllerAnimated:YES] viewWillAppear:YES]
它在前一个 VC 上调用 viewWillAppear。
我需要跳回根 VC 并调用 ViewWillAppear;然而,
[[navigationController popToRootViewControllerAnimated:YES] viewWillAppear:YES] 给我一个编码错误。
有没有办法在我的 appDelegate 中没有 applicationWillEnterForeground: 和 applicationDidBecomeActive: 方法来做到这一点
我已经在 init 中尝试过
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(willEnterForeground:)
name: UIApplicationWillEnterForegroundNotification
object:nil];
在正文中
-(void) willEnterForeground:(Notification*)NotificationCenter
{
(self viewWillAppear:YES);
}
这似乎也不叫 viewWillAppear。
【问题讨论】:
-
“给我一个编码错误” -- 你遇到了什么错误?