继续“< ViewController>”的“不平衡调用开始/结束外观转换”错误 [英] Keep getting "Unbalanced calls to begin/end appearance transitions for <ViewController>" error

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

问题描述

我的应用几乎运行完美。以下是我的应用程序的结构:

I have an app that is almost running perfectly. Here is how my app is structured:

故事板上的6个视图控制器总数。前3个视图控制器是最重要的。初始视图控制器具有登录和注册按钮。 登录按钮以模态方式呈现登录视图控制器,注册按钮以模态方式呈现注册视图控制器。

6 total View Controllers on the storyboard. The first 3 View Controllers are the most important. The initial View Controller has buttons to "Login" and "Signup". The "Login" button modally presents a Login View Controller and the "Signup" button modally presents a Signup View Controller.

注册视图控制器有3个用户名,密码字段,然后发送电子邮件,然后单击提交按钮。提交按钮将数据提交给我的Web服务器,如果一切都成功提交,它会调用自己的performSegueWithIdentifier方法。

The Signup View Controller has 3 fields for username, password, and email and then a "submit" button. The submit button submits the data to my web server and if everything submits successfully it calls the "performSegueWithIdentifier" method on itself.

这是声明:

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

我今晚花了2个小时试图让上面的方法调用工作,它终于可以工作了。为了使它工作,我不得不在故事板上选择我的注册视图控制器并转到编辑器>嵌入>导航控制器(如果我没记错的话,我必须这样做,因为注册视图控制器是以模态方式呈现的)。然后我从我的注册视图控制器的提交按钮拖到我要推送到的视图控制器并选择了推送,然后键入标识符名称。

I spent 2 hours tonight trying to get the above method call to work and it finally does work. To get it to work, I had to select my Signup View Controller on the storyboard and go to Editor > Embed In > Navigation Controller (If I remember correctly I had to do this because the signup view controller is presented modally). I then dragged from my Signup View Controller's submit button to the View Controller I want to push to and selected Push and then typed in an identifier name.

无论如何,在我尝试使用我们推送到使用方法调用的View Controller上的后退按钮之前,所有上述工作都完美无缺。如果我点击后退按钮,它会变成90%的黑色屏幕,顶部有一个空白的导航栏,后面有一个按钮,当然后面的按钮也不做任何事情。

Anyways, all of the above works perfectly fine until I try to use the back button on the View Controller that we pushed to using the method call. If I tap the back button, it goes to a 90% black screen with a blank nav bar at the top with a back button and of course that back button does nothing as well.

这是我在控制台中遇到的错误:

This is the error that I get in the console:

Unbalanced calls to begin/end appearance transitions for <VerificationViewController: 0x14ed1bb0>

验证视图控制器是注册视图控制器通过performSegueWithIdentifier方法推送的视图控制器。

Verification View Controller is the View Controller that the Signup View Controller pushes to via the performSegueWithIdentifier method.

有谁知道如何解决这个错误?

Does anyone know how I can fix this error?

我在下面列出了我的故事板在xcode中的样子。有一个视图控制器,我已编码但尚未连接,不应该有任何区别,所以你可以忽略登录VC右侧的视图控制器。

I have included a screenshot below of what my storyboard looks like in xcode. There is a view controller that I have coded but not connected yet and shouldn't make a difference anyways so you can ignore the View Controller to the right of the Login VC.

推荐答案

今天早上我在另一个stackoverflow问题中找到了答案。答案可以在这里找到。

I found the answer this morning in another stackoverflow question. The answer can be found here.

我最初的时候设置Push Segue,我点击并从按钮拖动,并且还在该按钮的IBAction方法实现中调用performSegueWIthIdentifier方法。这导致在按钮按下时执行2个相同的推动段。我刚刚把我的方法调用留在了IBAction中,删除了旧的push segue,并且只是这次我点击并从整个View Controller而不是它的按钮中拖动来创建一个新的push segue。

When I had originally setup the Push Segue, I clicked on and dragged from a button, and was also calling the performSegueWIthIdentifier method inside that button's IBAction method implementation. This was causing 2 identical push segues to be executed on the button press. I just left my method call in the IBAction, deleted the old push segue, and created a new push segue only this time I clicked on and dragged from the entire View Controller instead of it's button.

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

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