[英]viewWillDisappear called when tab bar item selected view controller set
Here's the scenario: 这是场景:
UINavigationController
as the top view. Window创建一个选项卡栏控制器,并添加多个带有UINavigationController
作为顶视图的选项卡栏项目视图控制器。 viewWillAppear
gets called on the first tab bar view. 在第一个标签栏视图上调用viewWillAppear
。 viewWillDisappear
gets called. viewWillDisappear
被调用。 viewWillAppear
is called. viewWillAppear
被调用。 viewWillDisappear
is called. viewWillDisappear
被调用。 viewWillDisappear
gets called AGAIN on the main view for the first tab bar item. viewWillDisappear
在第一个选项卡栏项目的主视图上被称为AGAIN。 Any ideas? 有任何想法吗?
I ended up working around this by keeping a BOOL that would tell me if I need to perform the viewWillDisappear work or not. 最后,我通过保留一个BOOL来解决此问题,该BOOL会告诉我是否需要执行viewWillDisappear工作。 Ugly but it works. 丑陋但行得通。 I was hoping there would be a better solution or that I was doing something that was obviously wrong. 我希望会有更好的解决方案,或者我做的事情显然是错误的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.