【发布时间】:2015-07-10 06:29:31
【问题描述】:
我在 UINavigationController 中嵌入了一个登录 UIViewController,用户输入 UserID/Password 然后单击 [Login] 按钮,如下所示:
2-textfields 和一个 UIButton,当用户点击按钮时我运行代码:
-(void)btLoginTapped:(id)sender{
[doLogin];
NSLog(@"Login Successful.")
[self.navigationController popToRootViewControllerAnimated:YES];
}
现在我在使用模拟器或 iOS 8 设备时出现问题
我将看到日志消息,但 ViewController 不会弹出,因为当我在 iOS 7 中使用模拟器/设备时,视图将正常弹出到根目录。
为什么不
[self.navigationController popToRootViewControllerAnimated:YES]
在 iOS 8+ 中工作,但它会在 iOS 7+ 中工作?
请注意,我已将 Animated 标志更改为 NO,我也尝试过:
[self.navigationController popViewControllerAnimated:YES/NO] 但还是同样的问题?!!
感谢任何输入。谢谢。
【问题讨论】:
-
检查我已编辑的答案。
-
我的问题不在于 [navigationController popViewControllerAnimated:] 它有效,而仅适用于运行 iOS 8 之前的设备或模拟器。但如果我在具有 iOS 8.4 的设备或模拟器中运行 popViewController 视图不会弹出?!有人有类似问题吗?
标签: objective-c ios7 ios8 uinavigationcontroller