如何在应用程序运行时释放标签栏视图?
我有一个应用程序,用户在主屏幕上登录,这是要显示的第一个屏幕。登录后,会出现一个选项卡栏视图。有一个选项卡允许用户注销,完成后,主屏幕会再次出现(以允许其他用户登录等)。我希望完成此操作后,将标签栏中加载的旧数据从内存中删除。目前,我正在设置 hidesBottomBarWhenPushed 来隐藏它,但数据不会被删除。我该怎么做呢?
I have an application in which the user logs in at the home screen which is the first screen to be shown. After login, a tab-bar view comes up. There is a tab which allows the user to log-off and when this is done, the home screen comes up again (to allow another user to login,etc). I want the old data loaded in the tab-bar to be removed from memory when this is done. Currently, I'm setting hidesBottomBarWhenPushed to hide it but the data is not being deleted. How should I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过像平常一样解除分配标签栏?例如,将
[TabBar release];
放在登录视图中的- (void)dealloc {
下,因为根本没有选项卡栏。或者您可以将 dealloc 放在-BackToMainMenu
方法下。这是否会删除您想要发布的任何数据?希望这有帮助。Have you tried dealloc'ing the tab bar like normal? For example put
[TabBar release];
under your- (void)dealloc {
in the login view since there is no tab bar at all. Or you can put the dealloc under a-BackToMainMenu
method. Is that getting rid of any data you want released? Hope this helps.