简体   繁体   English

使用Storyboard在XCode 4中以模态方式推送视图时出现“开始/结束外观转换的不平衡调用”警告

[英]“Unbalanced calls to begin/end appearance transitions” warning when push a view in a modal way in XCode 4 with Storyboard

After some research on the web without success, I come here to ask you the question about my warning. 经过网上的一些研究没有成功,我来这里问你关于我的警告的问题。

Actually, I have a view V1 with a navigation controller and I want to push a modal view V2 when V1 has finished loading. 实际上,我有一个带导航控制器的视图V1,我想在V1加载完成后推动模态视图V2。 So I use the performSegueWithIdentifier method (I'm using storyboard). 所以我使用performSegueWithIdentifier方法(我使用的是storyboard)。 Here is my code: 这是我的代码:

[self performSegueWithIdentifier:@"showConnexionViewSegue" sender:self];

And when I compile, I got this warning: 当我编译时,我得到了这个警告:

Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x6849b30>

Can anyone help me? 谁能帮我?

It sounds like you may be performing the segue in -viewWillAppear: thus generating two -viewWillAppear: messages without 2 corresponding -viewDidAppear messages. 听起来你可能正在-viewWillAppear:执行segue -viewWillAppear:因此生成两个-viewWillAppear:没有2个相应的-viewDidAppear消息的消息。

Try performing the segue in -viewDidAppear . 尝试在-viewDidAppear执行segue。

I had this problem, but what I had done is on a UIViewController I had linked a Segue from a UIButton and also coded it into a nextBtnPressed: function, so I was actually pushing two new UIViewControllers on the one button press. 我有这个问题,但我所做的是在一个UIViewController我已经从UIButton链接了一个Segue并且还将它编码为nextBtnPressed:函数,所以我实际上在按下一个按钮时推了两个新的UIViewControllers Limiting it to just the one segue fixed it. 将它限制为只有一个segue固定它。 But it took some investigating to see that I had done this double up. 但是,我花了一些调查才发现我已经完成了这项工作。

'Unbalanced calls to begin/end appearance transitions for ' '不平衡调用开始/结束外观转换'

Says an animation is started before the last related animation isnt done. 说动画是在最后一个相关动画没有完成之前开始的。 So, are you popping any view controller before pushing the new one ? 那么,在推新视图控制器之前,你是否弹出任何视图控制器? Or may be popping to root ? 或者可能会弹出根? if yes try doing so without animation ie [self.navigationController popToRootViewControllerAnimated:NO]; 如果是,请尝试不使用动画,即[self.navigationController popToRootViewControllerAnimated:NO];

And see if this resolves the issue, In my case this did the trick. 看看这是否解决了这个问题,在我的情况下,这就解决了问题。

The reasons for this are manifold and are very specific to the context and the programming. 其原因是多方面的,并且对于背景和编程非常具体。 For example, what I was doing was 例如,我在做的是

  1. initialising a sound file, playing it (asynchronously) for 1.4 seconds, 初始化声音文件,播放(异步)1.4秒,
  2. making an image move across the screen using animation timed to last 1.4 seconds and, 使用动画定时播放图像在屏幕上移动持续1.4秒,
  3. with a timer set to 1.4 seconds after step 2, pushing a viewcontroller. 在步骤2之后将计时器设置为1.4秒,推动视图控制器。

What i discovered is that if I DO NOT have the instructions for these 3 steps one after the other (if I mix them up), then I get the error "Unbalanced calls...". 我发现如果我不接受这三个步骤的指令(如果我把它们混淆),那么我得到错误“不平衡的呼叫......”。 Also, if I time the push of the viewcontroller to less than 1.4 seconds, I get the message as well. 此外,如果我将视图控制器的推动时间缩短到不到1.4秒,我也会收到消息。

So, check that the sequence and timing of your program instructions are correct. 因此,请检查程序指令的顺序和时间是否正确。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 XCODE:不平衡的调用以开始/结束外观转换 - XCODE: Unbalanced calls to begin/end appearance transitions for <UIFileUploadFallbackRootViewController 开始/结束外观转换的呼叫不平衡 - Unbalanced calls to begin/end appearance transitions 对UITabBarController的开始/结束外观转换的不平衡调用 - Unbalanced calls to begin/end appearance transitions for UITabBarController 不平衡的调用以开始/结束UIViewController的外观转换 - Unbalanced calls to begin/end appearance transitions for UIViewController 使用MediaPicker的开始/结束外观转换的不平衡调用 - Unbalanced calls to begin/end appearance transitions for Using MediaPicker 呼叫开始/结束状态转换的不平衡呼叫 <ViewController> , <Tab> - Unbalanced calls to begin/end appearance transitions for <ViewController>,<Tab> 不平衡的调用以开始/结束外观转换(我相信这与UINavigationController相关) - Unbalanced calls to begin/end appearance transitions for (I believe this is UINavigationController related) 在tableView中选择单元格时,对UIViewController的开始/结束外观过渡的不平衡调用 - Unbalanced calls to begin/end appearance transitions for UIViewController when selecting cells in tableView 从应用程序委托呈现模式视图不平衡的调用以开始/结束外观 - presenting modal view from app delegate unbalanced calls to begin/end appearance 对开始/结束外观转换的不平衡调用<UINavigationController: 0xa98e050> - Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0xa98e050>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM