Search code examples
iosiphoneback-buttonios9navigationcontroller

iOS9 Navigation Bar Back Button not working


Everything works perfectly before iOS 9.

However, when the app is running on iOS 9, nothing happens when back button is tapped so I am not able to go back as well as it keeps greyed out.

Also, I am not able to segue to the next view after the first segue.
For example,
HomePage -> tap a button to segue to view 1 -> Segued to View 1
-> tap on a button to segue to view 2 -> nothing happens

I uses the code below to perform segue,

UIViewController *push = 
[self.storyboard instantiateViewControllerWithIdentifier:@"storyboard_id"];
[self.navigationController pushViewController:push animated:YES];

This issue only happens at iPhone
but the app works flawlessly when running on a simulator
.

Thank you for your help.


Solution

  • Finally, the problem is solved. I have been create a new project and use the same method to perform segue and it segued flawlessly. So I excluded the possibility of Xcode might cause the problem. And I found that I have passed the device token for apps at my app delegate by a NSRunLoop, I don't why it will cause such a weird problem, I decide to save the device token at NSUserdefault, then get it at the home page and parse it to server. So it works like a charm now after I take away the NSRunLoop now.