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

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

问题描述

我读到其他用户遇到类似的错误,但此错误的情况不同。

I read SO about another user encountering similar error, but this error is in different case.

我最初添加视图控制器时收到此消息:

I received this message when I added a View Controller initially:

Unbalanced calls to begin/end appearance transitions for 
<UITabBarController: 0x197870>

该应用程序的结构如下:

The structure of the app is as follow:

我有一个5个标签的TabBarController链接到5个View Controllers。在初始显示选项卡中,我调出一个新的视图控制器作为应用程序的介绍覆盖。

I got a 5-tab TabBarController linked to 5 View Controllers. In the initial showing tab, I call out a new View Controller to overlay as an introduction of the app.

我使用此代码调用介绍视图控制器:

I use this code to call the introduction view controller:

IntroVC *vc = [[IntroVC alloc] init];
[self presentModalViewController:vc animated:YES];
[vc release]; 

在此 IntroVC 视图控制器出现后,上面的错误显示。

After this IntroVC view controller shows up, the above error shows.

p.s。我正在使用xCode 4.2& iOS 5.0 SDK,开发iOS 4.3应用程序。

p.s. I am using xCode 4.2 & iOS 5.0 SDK, developing iOS 4.3 app.

推荐答案

如果没有看到更多周围的代码,我无法给出明确的答案,但我有两种理论。

Without seeing more of the surrounding code I can't give a definite answer, but I have two theories.


  1. 你没有使用 UIViewController 指定的初始值设定项 initWithNibName:bundle: 。尝试使用它而不只是 init

此外, self 可能是标签栏控制器的视图控制器之一。始终从最顶层的视图控制器呈现视图控制器,这意味着在这种情况下要求标签栏控制器代表视图控制器显示重叠视图控制器。您仍然可以将任何回调代理保留到真实视图控制器,但您必须将标签栏控制器存在并解除。

Also, self may be one of the tab bar controller's view controllers. Always present view controllers from the topmost view controller, which means in this case ask the tab bar controller to present the overlay view controller on behalf of the view controller. You can still keep any callback delegates to the real view controller, but you must have the tab bar controller present and dismiss.

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

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