Interestingly, initWithHTML actually loads WebKit to do the actual conversion, and WebKit is not thread-safe. So to be absolutely bombproof, there should possibly be a thread check in there. Not that I’m aware of anything other than editors that run scripts on background threads.
I was aware of that but the class extension in AppKit do this for us, You can even make it thread safe by running initWithHTML: on another thread. Here is what Apple has to say about it:
For applications linked on OS X v10.5 and later, if NSAttributedString imports HTML documents on any but the main thread, the use of WebKit is transferred to the main thread via performSelectorOnMainThread:withObject:waitUntilDone:. This makes the operation thread safe, but it requires that the main thread be executing the run loop in one of the common modes.