Closed S1D1T1 closed 5 months ago
Hi @S1D1T1
When you run the async operation, there's no guarantee that the line after will be executed on the main thread. Thus, you must pop back to the main thread to keep working with the UI.
thanks for confirming. the world of async, wait, task, etal is not my comfort zone.
Don't know if this is my bug or yours, but I have a workaround:
wishing to maintain 1 source of truth, my object has a computed string value that reaches down into the attributed string. I believe I'm permitted to get/set. (all code samples simplified from the real app.)
I get/set this string value at numerous points. However, within a
Task
context, setting the value crashes in RichTextView_AppKit.swift, line 199Solution: defer the setting of the attributed string with
This is the only place where I've needed to do that.
The assertion fail happens below in RichTextContext_AppKit.swift