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

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -