Sto tentando di incollare una stringa attribuita nel mio NSTextView, ma si sta semplicemente mostrando come testo normale, senza attributi. Ho creato la mia stringa in questo modo:NSTextView e NSAttributedString
NSString *str = @"Parsing Directory Structure\n\n";
NSMutableAttributedString *attrstr = [[NSMutableAttributedString alloc] initWithString:str];
NSDictionary *attributes = @{
NSForegroundColorAttributeName : [NSColor blueColor],
NSFontAttributeName : [NSFont fontWithName:@"HelveticaNeue-Bold" size:20.f]
};
[attrstr setAttributes:attributes range:NSRangeFromString(str)];
[[self.textView textStorage] appendAttributedString:attrstr];
e sul NSTextView (all'interno della vista di scorrimento) Ho la casella "Permette Rich Text" controllato ancora, e la casella modificabile incontrollato. Praticamente sto cercando di usare questo come una finestra di output della console.
Grazie! Ha funzionato perfettamente. – Gargoyle