NSTextView- how to use?

Dogcow

Registered
How do I output lines of text to a NSTextView? I simply need a way for a java app I'm working on to spit output out through it. Also, for future reference, what's a good way to learn how to use the Apple frameworks and cocoa elements? I've found documentation more or less useless.

TIA
 
Uhmmm, how about myTextView.insertText("Whatever you want to insert");? You have to be careful though; that inserts text where the cursor was last, so if the text view is selectable, and the user changes the cursor location, you can have text inserted in places that you didn't intend. I forget the method, but one of them allows you to change the selected range, which you would choose to have a location of the last character (obtained from myTextView.stringValue().length()) and length of 0.

If you're having probs with the docs, it may be because you haven't read all the info in the super classes. Sometimes helpful methods and such are one level up; subclasses will inherent the methods, so the apple docs don't repeat what's been said before. Other than that, I find the docs straight forward. If you need help, just post here and I 'll do what I can.

HTH,
F-bacher
 
Ok, that's what I thought. Now I need to track down the real problem... Grr. Apple's debugger isn't the best. Thanks.
 
Back
Top