Unbalanced calls to begin/end appearance transitions for lt;UITabBarController: 0x197870gt;(对 lt;UITabBarController: 0x197870gt; 的开始/结束外观转换的不平衡调用)
问题描述
我读到另一位用户遇到类似 错误,但是这个错误是不同的情况.
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>
应用的结构如下:
我有一个 5 选项卡 TabBarController 链接到 5 个视图控制器.在初始显示选项卡中,我调用了一个新的 View Controller 来覆盖作为应用程序的介绍.
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.
附言我正在使用 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.
您没有使用
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.
这篇关于对 <UITabBarController: 0x197870> 的开始/结束外观转换的不平衡调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:对 <UITabBarController: 0x197870> 的开始/结束外观转换的不平衡调用
基础教程推荐
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- Android Volley - 如何动画图像加载? 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
