NavigationController is null

error.jpg

the code
using System;
using UIKit;
namespace Lesson1
{
public partial class ViewController : UIViewController
{
UIViewController receivingView;

        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
        }

        public void Initialize()
        {
            receivingView = Storyboard.InstantiateViewController("pantalla2") as pantalla2;
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }

        partial void Btnok_TouchUpInside(UIButton sender)
        {
            this.NavigationController.PushViewController(receivingView, true);
        }
    }
}

Posts

  • christopherpolskachristopherpolska PLUniversity ✭✭✭

    And the question is... ???
    Maybe you would put some effort when asking for time of other people? :P

    Create a new file called "pantalla2". Make it inherite from UIViewController, add proper constructor and ViewDidLoad function. Should be enough.

  • Thank you, I already worked, add a "navigation controller"

Sign In or Register to comment.