[Tips] navigationcontroller is nil

Have you faced the case like “self.navigationController = nil” when you’re coding on Xcode?

For example, like this.

[self.navigationController pushViewController:SecondViewController animated:YES];
NSLog(@"%@", self.navigationController);

Result is “self.navigationController = nil” and doesn’t work.

If you use “storyboard”, you can fix it very easy.
Just connect Navigation Controller and FirstViewController.

We hope this article help you :)