文本少于10个字符的UITextView会挂起iOS 9 [英] UITextView with text less than 10 characters hangs iOS 9

查看:104
本文介绍了文本少于10个字符的UITextView会挂起iOS 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从iOS 9(我使用Xcode 7.0 beta 6(7A192o))开始,如果文本视图的文本少于10个字符,带有UITextView的Objective-C应用程序将挂起。 CPU使用率高达99-100%,整个系统都会挂起。

Starting from iOS 9 (I used Xcode 7.0 beta 6 (7A192o)), an Objective-C app with UITextView will hang if the text view's text is less than 10 characters. CPU usage goes up to 99-100% and the whole system hangs.

如何重现:


  1. 从模板(或其他任何东西)创建一个全新的单一视图应用程序。

  2. 在故事板中,添加一个默认设置的UITextView主视图。

  3. 将文本设置为长度小于10个字符的字符串。

  4. 在模拟器中启动应用程序(任何设备,如只要它是iOS 9)。

  5. 启动后,在显示单个视图之前,系统将挂起,CPU使用率将永远达到最大值。

  6. 将文本设置为超过10个字符的任何其他文本,并且应用程序正确运行.a

  1. Create a brand new single view app from template (or anything else).
  2. In storyboard, add a UITextView with default settings anywhere in the main view.
  3. Set the text to a string that is less than 10 characters long.
  4. Launch the app in simulator (any device, as long as it's iOS 9).
  5. Upon launch, before displaying the single view, the system will hang and CPU usage will go to maximum forever.
  6. Set the text to any other text that's more than 10 characters and the app runs correctly.a

看起来像约束或任何其他设置不要影响这种行为。

Looks like constraints or any other settings do not affect this behaviour.

立即解决方案是不要少于10个字符,但是,这是蹩脚的。

The immediate solution would be to simply not have less than 10 characters, but, well, that's lame.

你可以看看这个github存储库也证明了这个问题。

You can check out this github repository that also demonstrates the problem.

我还向Apple提交了一个错误报告(bug no。 22736256,虽然你可能还没有看到它。)

I also submitted a bug report to Apple (bug no. 22736256, although you probably can't see it there yet).

最奇怪。错误。永远。

是否还有人遇到过这个?

推荐答案

根据发布Xcode 7.1.1的说明现在应该修复:


在iOS上加载时,包含1到11个字符的UITextView元素的故事板和笔尖不再挂起。 (23264732)

Storyboards and nibs containing UITextView elements with between 1 and 11 characters no longer hang when loaded on iOS. (23264732)

这篇关于文本少于10个字符的UITextView会挂起iOS 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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