osx - NSAttributedString in NSTextView not showing up unless you scroll -
i'm trying set attributed string in nstextview, , if text taller text view, text doesn't show @ unless scroll text box.
there aren't many posts attributed strings in nstextview, maybe i'm doing wrong. here's how i'm setting text:
[[self.textview textstorage] appendattributedstring:attributedstring];
you have programmatically tell nstextview
has make new string visible:
nsuinteger length = [[self.textview string] length]; [self.textview scrollrangetovisible:nsmakerange(length,0)];
this should work independent of if appended string "simple" string or attributed string.
Comments
Post a Comment