UITextView中的归因文本导致崩溃

Moo*_*Cat 4 cocoa-touch uitextview nsattributedstring ios

这是我在UITextView中显示属性字符串的代码

NSMutableAttributedString *recipeString =[[NSMutableAttributedString alloc]init];
    [recipeString appendAttributedString:string1];
    [recipeString appendAttributedString:string2];
    [array addObject:recipeString];
Run Code Online (Sandbox Code Playgroud)

这段代码在for循环中.string1并且string2NSMutableAttributedString.

之后:

self.textView.text = [array objectAtIndex:self.appDelegate.selectedCell];
Run Code Online (Sandbox Code Playgroud)

文本视图是一个IBOutlet.

它崩溃了这个例外:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteAttributedString _isCString]: unrecognized selector sent to instance 0x8e866f0'
Run Code Online (Sandbox Code Playgroud)

有关如何修复此崩溃的任何想法?

Moo*_*Cat 8

我不得不使用以下attributedText属性UITextView:

self.textView.attributedText = [array objectAtIndex:self.appDelegate.selectedCell];
Run Code Online (Sandbox Code Playgroud)