How do I open an new window from AccessoryButtonTapped button from my BasisViewController. Right now I have this for open, but the problem is the NavigationController which I can’t find because I’m inherent the UITableViewSource.
Opskrift ops = new Opskrift(item.ImageName, item.Name, item.optionTxt, item.SubHeading)
this.NavigationController.PushViewController(this.opskrift, true);
If I use ops.NavigationController.PushViewController(this.opskrift, true);
I get an Object reference not set to an instance of an object exception.
Give your UITableViewSource inherited class access to your controller by passing it through its constructor:
Your Opfskrift controller’s NavigationController property returns null because it is not part of a navigation controller’s stack when you initialize it (=hasn’t been “pushed” in a navigation controller). Of course, BasisViewController must also belong to a navigation controller for its NavigationController property to contain something other than null.