0

I am having issues with subviews not loading for a view controller this happens after having added a UITabBarController to a storyboard.

You can reproduce this by 1) Creating a project (Objective c single pane) 2) Delete the contents in the story board. Add a Tab View Controller. 3) Add a view controller with some subviews 4) Set the view controller from three as initial.

enter image description here

Output: I am sure the subview is not loading because when I use debugger I see only the layout guides in viewDidLoad

(lldb) po self.view.subviews
<__NSArrayM 0x7f9a20417df0>(
<_UILayoutGuide: 0x7f9a20416d40; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0x7f9a20415820>>,
<_UILayoutGuide: 0x7f9a204176e0; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0x7f9a20415b50>>
)

enter code here

If I create a second storyboard and point the app to that and create a view controller there. It works as expected.

I can even copy paste the view controller from the second storyboard into the first and this will work also

Even if I delete the TabviewController and friends from the storyboard the storyboard remains broken.

Ryan Heitner
  • 13,119
  • 6
  • 77
  • 119
  • 1
    In the preview for iPhone and iPad, does the window show up as you expect or with the red box missing? Also try giving the controller a storyboard id and see if that helps. – Rory McKinnel Apr 16 '15 at 09:58
  • The preview is also missing. Play around with compact/compact etc with preview on and you can see the issues before your eyes. Thanks for the input it helped. – Ryan Heitner Apr 16 '15 at 10:12
  • Glad you got it working. It sounded size class related, but I was not sure that views themselves could actually be controlled using size classes. I was off looking that up. I do everything in Any/Any now having been similarly burned during the iOS8 upgrade fun. – Rory McKinnel Apr 16 '15 at 10:17

1 Answers1

0

The strange behaviour had nothing to do with UITabViewController.

It seems as if it is a bug or a misunderstanding on my part related to size classes

If I change the view at the bottom of the editor to wCompact hCompact I start having problems but if it is wAny hAny all works fine.

enter image description here

If you start using compact/compact there are some very strange and unexpected behaviours

Ryan Heitner
  • 13,119
  • 6
  • 77
  • 119