I'm new to Cocoa, and I've been having a problem that is absolutely maddening. I'm trying to write a simple NSString
to an NSTextView
, and for some reason it just won't respond. No compiler warnings, no runtime errors, just a blank textview
.
I'm able to use other methods of NSTextView like selectAll, delete, setSelectedRanges, etc. They work fine, and from everything I've read in Apple's Docs and on the net, methods like setString should work. I've also tried:
[[textView textStorage] setAttributedString:aString]
using an NSAttributedString version of the text, again with no result. Even the string method works perfectly and returns the contents of the textView, but for some reason setString and the like won't. The TextView is editable. In debugger the value of the string I'm trying to write shows up without a problem.
I've searched everywhere on the 'net, and it seems that no-one else is having this problem.
Thanks, Joe
textView
is in fact non-nil
. Make sure that you referencetextView
to the view in Interface Builder. – notnoop