ixany ixany - 17 days ago 11x
Swift Question

Display Text using a NSScrollView

I just started learning Swift and created a little OSX-App, in which I want to use a

to display a
. I tried:

@IBOutlet var ScrollViewOutlet : NSScrollView
var attributedString = NSMutableAttributedString(string: myText)

... but sadly, it's not working. it's a bit confusing, because with an
instead, I have no problems. Where is my mistake?


seems that the earlier betas of xcode had some issues with this kind of outlets (as you can see here swiftwtf.tumblr.com/post/88387419568/nstextview), however, since xcode 6 beta 6 its working.

i noticed that you can't change the content of the NSScrollView or NSTextView directly, so i did the following, setting only the string in textStorage

textFieldOutlet.textStorage.mutableString.setString("your string here")

... and it worked fine.