Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

ViewLoad & ViewDidLoad

rumurillorumurillo USMember
edited April 2016 in Xamarin.iOS

I have a Xamarin iOS project which implements a main.storyboard that implements various Custom-views and ViewControllers.
I display de corresponding ViewController's from AppDelegate using:

public UIStoryboard StoryA = UIStoryboard.FromName ("Main", null);

var init = StoryA
                .InstantiateViewController ("myViewController") as myViewController;

var nav = new UINavigationController(init);

Window.RootViewController = nav;
Window.MakeKeyAndVisible (); 

Inside the controller I use ViewLoad() and ViewDidLoad() overrides. I have used these methods regularly a few times before, but, now they aren't getting called when Controllers is constructed and loaded. Is there a problem with this call? or what might be the issue behind this?


  • Luis_dmLuis_dm USMember ✭✭✭

    try this:

    Principal control = this.Storyboard.InstantiateViewController("namecontroller1") as Principal;
    this.NavigationController.PushViewController(control, true);

Sign In or Register to comment.