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?

Answers

  • 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.