iOS9导航栏后退按钮不起作用 [英] iOS9 Navigation Bar Back Button not working

查看:133
本文介绍了iOS9导航栏后退按钮不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一切在iOS 9之前都能完美运行.

Everything works perfectly before iOS 9.

但是,当应用程序在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.

此外,我无法在第一次搜索后选择下一个视图.
例如,
主页->点按一个按钮即可查看1->依次查看1
->轻按按钮以查看2->什么也没发生

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

我使用下面的代码执行segue,

I uses the code below to perform segue,

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

此问题仅在iPhone上发生
但该应用在模拟器上运行时可以完美运行
.

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

谢谢您的帮助.

推荐答案

最后,问题已解决. 我已经创建了一个新项目,并使用相同的方法执行segue,并且完美地进行了segu.所以我排除了Xcode可能导致问题的可能性.而且我发现我已经通过NSRunLoop在我的应用程序代表处为应用程序传递了设备的令牌,我不知道为什么会导致这种奇怪的问题,我决定将设备令牌保存在NSUserdefault中,然后在主页上获取它.并将其解析到服务器.因此,在我现在拿走NSRunLoop之后,它现在就像魅力一样.

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.

这篇关于iOS9导航栏后退按钮不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆