iOS 9 Segue 导致应用程序冻结(未引发崩溃或错误) [英] iOS 9 Segue Causes App To Freeze (no crash or error thrown)

查看:16
本文介绍了iOS 9 Segue 导致应用程序冻结(未引发崩溃或错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在这个应用程序上工作了几个月,从我记事起,我从来没有遇到过 segue 问题.代码在调用 performSegueWithIdentifier 方面没有变化,但自从我最近更新到 Xcode 7 和 iOS 9 以来,我一直无法解决这个问题.

I have been working on this app for months now and from as far back as I can remember I have never had an issue with segues. The code is unchanged in terms of calling performSegueWithIdentifier but since my recent update to Xcode 7 and iOS 9 I have not been able to tack this issue.

我试过了:

  • 删除按钮并创建带有转场链接的新按钮
  • 使用按钮直接转场进行查看,不使用performSegueWithIdentifier
  • 将按钮连接到新的空白视图控制器

当我按下按钮时,目标 VC 上没有调用初始加载函数(例如:ViewDidLoadViewWillAppear 等).当我将它连接到一个空白视图时,segue 使用相同的代码可以正常工作.

When I press the button, no initial load functions are called on the destination VC (Ex: ViewDidLoad, ViewWillAppear, etc). When I connect it to a blank view, the segue works fine with the same code in place.

由于代码永远不会停止或中断,并且在 Xcode 上运行时似乎只是冻结"在原地,我似乎甚至无法将其缩小到导致问题的原因.我有一个类似的 segue,它也从同一个 ViewController 上的另一个按钮调用,没有任何问题.

Since the code never stops, or breaks, and just seems to "freeze" in place while still running on Xcode I can't seem to even narrow this down to whats causing the issue. I have a similar segue that is also called from another button on the same ViewController that has no issues whatsoever.

非常感谢您对此事的任何想法!

Any thoughts on the matter are greatly appreciated!

我已将问题缩小到 UITextView 导致问题的原因.删除文本视图后,页面将通过 segue 正常加载.我想知道 iOS 8 和 iOS 9 在 UITextView 方面有什么变化,因为我将不得不删除文本视图并完全重新添加新的文本视图.

I have narrowed the issue down to the UITextView's causing the problem. Once the Text Views were removed the page loads fine via segue. I wonder what changed between iOS 8 and iOS 9 in terms of UITextView as I will have to remove the text views and completely re add new text views.

推荐答案

所以基本上 segue 冻结了,因为我在 destinationViewController 中使用了 UITextView.以下解决了该问题:

So basically the segue was freezing because of the UITextView's I was using in the destinationViewController. The following fixed the issue:

  • 删除所有UITextView
  • 添加新的 UITextView
    • 您必须保留默认的lorem 强加文本并在viewDidLoad()
    • 中以编程方式更改它
    • Delete all UITextView's
    • Add new UITextView's
      • you must leave the default lorem imposed text and change this programmatically in the viewDidLoad()

      这是对我的修复,从我对这个问题所做的研究来看,这似乎是 iOS 9 和 Xcode 7 中的一个错误.

      This was the fix for me, and from the research I have done on the issue it seems this is a bug in iOS 9 and Xcode 7.

      干杯!

      注意: 删除 UITextView 中的文本(或使其更长约 12 个字符)足以解决它,无需删除并重新创建它们.此问题已在 Xcode 7.1.1 及更高版本中修复.

      NOTE: Removing the text in the UITextView (or making it longer then ~12 characters) is sufficient to work around it, no need to delete and recreate them. This is fixed in Xcode 7.1.1 and later.

      这篇关于iOS 9 Segue 导致应用程序冻结(未引发崩溃或错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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