/* -[NSTextView textStorage] must be used from main thread only */ // NSTextStorage *temp222 =theTextView.textStorage; if (NSThread.isMainThread) { [stringContents appendAttributedString:aString]; } else { dispatch_async(dispatch_get_main_queue(), ^() { [self->stringContents appendAttributedString:aString]; }); }