Good Day,
I have the latest VS2019 for Mac installed with the latest updates. When override the rootviewcontroller everything seems fine. Built standard single view xamarin.ios app... and inserted a NavigationController.
[Export("window")]
public UIWindow Window { get; set; }
[Export("application:didFinishLaunchingWithOptions:")]
public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
Window = new UIWindow(UIScreen.MainScreen.Bounds);
UIViewController controller = UIStoryboard.FromName("Main", null).InstantiateInitialViewController() as UIViewController;
UINavigationController navController = new UINavigationController(controller);
Window.RootViewController = navController;
Window.MakeKeyAndVisible();
application.KeyWindow.RootViewController = navController;
return true;
}
However, when I try and access the NavigationController from the Default View Controller it is null.
public partial class ViewController : UIViewController
{
public ViewController(IntPtr handle) : base(handle)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
if (NavigationController is null)
lblNavControllerInfo.Text = "None";
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
}
This used to work... what am I doing wrong?