我正在使用NSAttributedString并在UITextview上设置它会崩溃但是当我在UILabel上使用NSAttributedString设置此文本时它工作正常。代码如下。它为何与UITextView崩溃?
let label = UILabel(frame: CGRectMake(0, 0, 400, 400))
label.center = self.view.center
label.numberOfLines = 0
self.view.addSubview(label)
label.attributedText = appDelegate.attributedText
let textview= UITextView(frame: CGRectMake(0, 0, 400, 400))
textview.center = self.view.center
self.view.addSubview(textview)
textview.attributedText = appDelegate.attributedText