Sonoma 14.5, Xcode 16.0 (16A242d)
Pure SwiftUI application, MacOS (document-based), a single TextView with a binding instead of the template solution with added UndoManager functionality (which seems unnecessary).
The error does not happen every time:
– if I type in an existing document, it's fine; if I switch to Xcode and back to my app, the error appears.
– if I create a new document and select the existing string, it's fine. If I create a second new document and select the string in that, I get the error.
– if I switch between two dirty unsaved documents, I get the error.
and so on. I'm reasonably confident there are patterns to this, but I don't have the time or patience to try all of them.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: