UISplitViewController and UINavigationController d

2019-09-09 20:03发布

问题:

I'm trying (for experiment) to work with multiple storyboards. The first storyboard (starts at startup) contains only one view controller that executes some code and download json data from a website.

first storyboard http://i60.tinypic.com/33l3055.png

When finish the download task, the view controller (of first storyboard) set the entry Point of Second storyboard as root view controller after instantiating it.

UIStoryboard *mainSB = [UIStoryboard storyboardWithName:@"SecondStoryboard" bundle:[NSBundle mainBundle]];
    UITabBarController *rootTabBarController = (UITabBarController *)[mainSB instantiateInitialViewController];

    dispatch_sync(dispatch_get_main_queue(), ^{

        ...

        self.view.window.rootViewController = rootTabBarController;

This Second story board contains a tabbar controller with a split view controller inside it:

second storyboard http://i61.tinypic.com/9jkc9d.png

All works but there is a strange behaviour of navbar controller inside the splitview controller. Its back button works if pressed but doesn't display properly because there is only the "back" text without the left arrow.

!the problem with navigation bar http://i62.tinypic.com/2a615l4.png

Only after few minutes and some transitions between master and detail view the back button display properly with the left arrow.

navigation bar ok after some transitions http://i61.tinypic.com/16aa7tu.png

(All works correctly if I use only the Second storyboard from the startup)

I Know that in this case I can use only one storyboard but I want to know if is not correct to work in this way with multiple storyboards or if it's a bug.

回答1:

With the new Xcode 7 Beta and iOS 9 all perfectly work.

Whit the same configuration of files the chevron of navigation controller display properly. I don't know why, Apple in this WWDC has released the storyboard reference, but I think that was a bug of UISplitViewController.