I'm using Monotouch C# to write an iPhone App with a number of different screens. To keep things simple I will describe only a few screens that lead to the controller which I am having issues with.
The problem I am having is that I receive this error message when I create a class which inherits from UITabBarController:
Application windows are expected to have a root view controller at the end of application launch
In my AppDelegate class I initialise a UIViewController and a UINavigationController. I set my RootViewController on the UIWindow object to use the navigation controller like this:
var splashController = new SplashController(); // UIViewController
_navigationController = new UINavigationController(splashController);
...
_window = new UIWindow(UIScreen.MainScreen.Bounds);
_window.RootViewController = _navigationController;
_window.MakeKeyAndVisible();
Up until now I haven't had an issue with running my applications. However I created a new class which inherits from UITabBarController and I get an error message described above. I can post the code to it if needs be but I've also tried running my application with an empty class which inherits from UITabBarController and I still receive the same error message.
Even if the class never gets called in my code through commenting out or deleting the PushViewController call I still can't run the application.
The call to the tab bar controller will eventually look like this:
SplashController (UIViewController) > push > HomeController (UIViewController) > push > MenuController (DialogViewController) > push > StatsController (UITabBarController)
I'm guessing there's something extra that I am missing here but after Googling and searching around I couldn't find an answer to my problem. Thanks for any help
If you are using a UITabBarController it should look something like this:
The UITabBarController should be the RootViewController.
I guess this link may help you
Applications are expected to have a root view controller at the end of application launch
Also some times it occurs when we don't mention initial view controller in plist.