Scrolling through UITableView causes Exception and Crash only on iPhone 5C

﹥>﹥吖頭↗ 提交于 2019-12-01 20:03:55
Aaron Brager

The bug is not in the code you posted. The bug happens when a UITextView is reused while its links are still being generated, which is done asynchronously.

See these similar Stack Overflow questions:

Many users have reported that setting the text view's text property to nil in the cell's prepareForReuse method resolves the issue. Alternatively you could use a library like TTTAttributedLabel instead of a text view.

The fact that it only appears on an iPhone 5C is probably a red herring. I bet this device is still running iOS 7, and the other devices have been updated to a newer version of iOS.


On a side note, there may be edge cases that your regex doesn't cover. I would delete your twitter parsing method and replace it with the official twitter-text-objc library.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!