NavigationController is Null in some of the ViewControllers

Udi_IdanUdi_Idan ILMember ✭✭

I have an Xamarin iOS project that is already built and available in the AppStore.

Recently I needed to make some changes to the project, but from some reason it stopped working. The NavigationController of some of the controllers is Null and when trying to navigate, using custom segue, I'm getting exceptions.

In the following code NavigationController is null:

SourceViewController.NavigationController.View.Layer.AddAnimation(transition, CALayer.Transition);

I'm using a storyboard, as can be seen in the attached image.

What can cause this change and how can I fix it?

Answers

  • Udi_IdanUdi_Idan ILMember ✭✭

    Fixed it. Seems that from some reason the controller was viewed as a modal instead of pushed and so didn't have a NavigationContoller.

  • MaxenceMaxMaxenceMax Member ✭✭

    hi @Udi_Idan !

    How do you fixed it ?

  • Udi_IdanUdi_Idan ILMember ✭✭

    Hi,
    I've changed the Storyboard segue in the Attributes Inspector of the Interface Builder, so it will push the next ViewController (push will add it to the UINavigationController) and not show it modally (which will not add it).

    Hope it helps.

Sign In or Register to comment.