对< UINavigationController:0xa98e050>的开始/结束外观转换的不平衡调用 [英] Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0xa98e050>

查看:87
本文介绍了对< UINavigationController:0xa98e050>的开始/结束外观转换的不平衡调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译我得到的代码时


的开始/结束外观转换的不平衡调用< UINavigationController :0xa98e050>

警告。

这是我的代码

KVPasscodeViewController *passcodeController = [[KVPasscodeViewController alloc] init];
passcodeController.delegate = self;

UINavigationController *passcodeNavigationController = [[UINavigationController alloc] initWithRootViewController:passcodeController];
[(UIViewController *)self.delegate presentModalViewController:passcodeNavigationController animated:YES];


推荐答案

我知道这是一个老问题,但对于对于那些再次遇到这种情况的人来说,这就是我发现的。

I know this is an old question, but for the sake of those who run across this again, here is what I've found.

首先,问题没有说明新的 viewController <正在调用/ code>。
我怀疑这是从调用的 - (void)viewDidLoad

Firstly, The question does not state where the new viewController was being called.
I suspect this was called from -(void)viewDidLoad

将相应的代码移动到 - (void)viewDidAppear:,问题应该消失。

Move the appropriate code to -(void)viewDidAppear: and the problem should go away.

这是因为在 -viewDidLoad 时,视图已加载,但尚未显示,动画和视图尚未完成。

This is because at -viewDidLoad, the view has loaded, but has not yet been presented and the animations and views have not completed.

如果您打算推窗,请在窗口出现并涂漆后再进行操作。

If your intent is to push a window, do it after the window has been presented and has painted.

如果您发现自己使用计时器来控制系统行为,请问问自己您做错了什么,或者如何更好地做到这一点。

If you ever find yourself using timers to control system behavior, ask yourself what you are doing wrong, or how you could do it more properly.

这篇关于对&lt; UINavigationController:0xa98e050&gt;的开始/结束外观转换的不平衡调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆