I have NSTextView that i add text to using
def puts(val)
storage = @output.textStorage
storage.beginEditing
storage.appendAttributedString(NSAttributedString.alloc.initWithString(val+"\n"))
storage.endEditing
end
This works for few times but at some point in time it hangs the whole program (spinning ball of death).
I’m calling this method from MacRuby thread so i think that it has something to do with it.
I set the
stringproperty of myNSTextViewcalledhome_textbyI’ve Never had a “beach volleyball/pizza of death”. When I’m not sure I can rely on a default value I add a control on the string I want to add to the
NSTextViewto avoid setting it to a nil value. Basic stuff here, I know sorry!Are you doing any I/O operation, in your main thread or somewhere else, without using Cocoa most robust Asynchronous APIs? Like downloading stuff from the web which , for example, would be performed more safely using
NSURLDownloadinstead of eitherNet::HTTP.get('...a url...','..a path..")or
that are synchronous.
This could explain the randomness of your problem, although it’s just one of the possible causes.