简体   繁体   English

uiviewcontroller中的uitableview在xcode 5中消失了

[英]uitableview in uiviewcontroller disappears in xcode 5

I am building an ios application for iPad, I used uitabbar to show some uiviewcontrollers, I added in some of these uiviewcontrollers an uitableview. 我正在为iPad构建一个ios应用程序,我使用uitabbar展示了一些uiviewcontrollers,并在其中一些uiviewcontrollers中添加了uitableview。 Now when I first load the application the uitableview appears and show my data. 现在,当我第一次加载应用程序时,会出现uitableview并显示我的数据。 if I opened an uiviewcontroller that is not in the uitabbar and return to the tab bar the table disappears !!! 如果我打开了不在uitabbar中的uiviewcontroller并返回到选项卡,表将消失! then if I choose another tab from uitabbar tabs and return to my tab (the one which has the uitable that disappears) the table show up !!! 然后,如果我从uitabbar选项卡中选择另一个选项卡,然后返回到我的选项卡(具有uitable的选项卡消失了),该表就会显示! anyone know how can I fix this problem ? 有人知道我该如何解决这个问题?

I think it is an Storyboard/layout issue !! 我认为这是情节提要/布局问题!

any help will be appreciated, thanks 任何帮助将不胜感激,谢谢

Sounds to me like you are doing some kind of initialization in viewDidLoad which is not called again when you come back from a child view controller. 在我看来,您正在viewDidLoad中进行某种初始化,当您从子视图控制器回来时不会再次调用它。

One quick fix could be to move that code to viewDidAppear method. 一种快速的解决方法是将代码移至viewDidAppear方法。 If you further want to understand when either of this method was called or not, you could throw in some NSLog statements in each. 如果您还想了解何时调用该方法或不调用该方法,则可以在每个方法中放入一些NSLog语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM