NSAttributedString EXC_BAD_ACCESS KERN_INVALID_ADDRESS crash

前端 未结 1 555
独厮守ぢ
独厮守ぢ 2021-01-19 06:13

I am using NSAttributedString in my code. I am getting the below crash sometimes.

Crashed: com.apple.main-thread EXC_BAD_ACCESS KER

相关标签:
1条回答
  • 2021-01-19 06:59

    If you working with HTML strings in NSAttributedString it also may crash, as it said in docs:

    The HTML importer should not be called from a background thread (that is, the options dictionary includes NSDocumentTypeDocumentAttribute with a value of NSHTMLTextDocumentType). It will try to synchronize with the main thread, fail, and time out. Calling it from the main thread works (but can still time out if the HTML contains references to external resources, which should be avoided at all costs). The HTML import mechanism is meant for implementing something like markdown (that is, text styles, colors, and so on), not for general HTML import.

    Anyway you should provide more details for your crash to get correct answer.

    0 讨论(0)
提交回复
热议问题