I have a call, within an NSTextView subclass, that looks like this:
[[self textStorage] replaceCharactersInRange:fullRange withAttributedString:sa];
This call used to work fine and now (after Snow Leopard installation) generates a short message in the console: "Oops". It doesn't crash, it just generates this message and then fails to set the text correctly. The "Oops" message is coming from Apple code, not mine, which is absolutely infuriating.
Can anybody tell me what is going on? Why would the textStorage of an NSTextView EVER generate this message?
I don't know whether it is relevant that when the Oops message is generated, fullRange is equal to (0,0).
...LATER...
Well, I've managed to fix this. This is going to sound crazy. It turns out that the NSTextView I was working with was added to an NSStatusItem as part of an awakeFromNib routine. For whatever reason, Snow Leopard refuses to display the status item until awakeFromNib returns.
When I moved the code for display of the status item into applicationDidFinishLaunching, the problem went away.
I'm crazy, you say? I know, this sounds silly, but try it yourself using sleep(). Prep a statusItem and then sleep() in your awakeFromNib routine. The statusItem won't appear until sleep is over and awakeFromNib returns.