Unbalanced calls to begin/end appearance transitions for lt;UINavigationController: 0xa98e050gt;(对 lt;UINavigationController: 0xa98e050gt; 的开始/结束外观转换的不平衡调用)
问题描述
在编译我得到的代码时
对 <UINavigationController: 0xa98e050>
的开始/结束外观转换的不平衡调用"
"Unbalanced calls to begin/end appearance transitions for
<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
的调用位置.
我怀疑这是从 -(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.
这篇关于对 <UINavigationController: 0xa98e050> 的开始/结束外观转换的不平衡调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:对 <UINavigationController: 0xa98e050> 的开始/结束外观转换的不平衡调用


基础教程推荐
- UINavigationBar 隐藏按钮文本 2022-01-01
- 更改 UITableView 部分标题的颜色 2022-01-01
- Firebase 云消息传递令牌未生成 2022-01-01
- UINavigationItem 的持久 rightBarButtonItem 属性 2022-01-01
- Android - 如何在runOnUiThread 中将数据传递给Runnable? 2022-01-01
- 在视图控制器的宽度上水平均匀分布 UIButton 的最简单方法? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- EditText 中的 setHintTextColor() 2022-01-01
- 从 UIWebView 访问元数据 2022-01-01
- 在 iOS 7 下 CCMenu 错位 2022-01-01