This really shouldn't be this hard but I'm stumped. I just want to do something simple like write o开发者_StackOverflow社区ut a log type area in my app. Here is the problem, if I use NSTextField then the message gets overwritten, and if I use NSTextView I try and lock the edit feature with "setEditable" but this seems to lock up the app. I get too many messages and it doesn't write out everything fast enough as the threads.
Pretty much what I want to reproduce is a scrolling log which the user can see, like console and using NSLog. What should I be using?
Thanks for any help.
Writing text means there's drawing code. Drawing is expensive and can tie up your main thread, so you may want to try dedicating a thread/nsoperation to appending an outputString and setting a textView's textValue to the outputString. This way, the thread that you are now running on doesn't get tied up with the drawing code.
精彩评论