UITabBarViewController 崩溃
我是 iOS 编程新手。我在 github 上创建了代码的公共存储库,存储库的 url 为 [email protected ]:abhinavtyagi/paparazzi.git
我在使用 UITabBarController 时遇到问题。该应用程序的主视图中有两个选项卡,每个选项卡视图都包含一个导航控制器。
该应用程序由以下三个视图组成(对于每个选项卡视图) #1#第一个View显示图像类型(风景、花卉、行星) #2# 第二个视图使用表格视图列出图像及其名称。 #3# 当在上一个(第二个)视图中选择任何单元格时,图像将在下一个视图中全屏显示。 如果我们使用后退按钮进行导航,则效果很好。但是,当我们在第三个视图(全屏图片)中点击标签栏两次,直接从第三个视图移动到第一个视图时,应用程序崩溃。
我无法理解为什么会发生。 在这方面的任何帮助将受到高度赞赏。
谢谢 阿比纳夫
I am novice to iOS programming. I have created a public repository of the code at github the url of the repository is [email protected]:abhinavtyagi/paparazzi.git
I am facing a problem in using UITabBarController. The application have two tabs in the main view with each tabView containing a navigation controller.
The application consists of three views as follows (for each tabview)
#1# first View shows the types of images (landscape, flowers, planets)
#2# second view uses table view to list the images and their names.
#3# when selected any cell in the previous(2nd) view, the image is shown in full screen in the next view.
This works fine if we use back buttons for the navigation. But the application crashes when we move to first view directly from the third BY TAPPING THE TAB BAR TWICE when in third view(full screen pic).
I am not able to understand why its happening.
Any help in this regard will be highly appreciated.
Thanks
Abhinav
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您点击标签栏按钮两次....它会调用其
viewController
的viewDidLoad
(在您的情况下navigationController的rootViewController
)... ....可能是这导致了崩溃/因为所有内容都会重新加载......when you tap on tab bar button twice.... it calls
viewDidLoad
of itsviewController
(in your caserootViewController of navigationController
)....... may be this is causing the crash/ as everything will be reloaded.....