You should create your view controllers in ViewDidLoad of the UITabBarController, not in the ViewDidAppear. I use the code below (first part is in your AppDelegate class):
// WARNING: Do not make these variables local. MonoTouch will loose the reference to them!
private UIWindow _mainWindow;
private MainTabBarController _mainTabBarController;
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
_mainWindow = new UIWindow(UIScreen.MainScreen.Bounds);
_mainTabBarController = new MainTabBarController();
_mainWindow.AddSubview(_mainTabBarController.View);
_mainWindow.MakeKeyAndVisible ();
return true;
}
Your MainTabBarController class should look like this:
public class MainTabBarController : UITabBarController
{
public override void ViewDidLoad ()
{
ViewControllers = new UIViewController[]
{
new ViewControllerTab1(),
new ViewControllerTab2(),
new ViewControllerTab3(),
new ViewControllerTab4(),
new ViewControllerTab5()
};
SelectedIndex = 2;
}
}
This will show Tab3 (with index 2) at startup.
ViewControllerTab1 etc. are classes derived from eg. UIViewController or UINavigationController which implement their user interface in their own ViewDidLoad()