I have an NSTextView
in an NSPersistentDocument
window. I bind the text field's contents to a "binary data" Core Data field, but when I type text into the text view, the document's title bar doesn't say "Edited" until the text view loses focus. Thus, if I quit after making an edit, the new data isn't saved.
If I pass the NSContinuouslyUpdatesValueBindingOption
flag to the text view binding, "Edited" appears immediately, but performance really suffers in long documents.
How do I let Core Data know that there are unsaved changes without actually assigning all the text data on every change?
(This question is like "Binded NSTextField doesn't update the entity until it lose the focus" except I can't use NSContinuouslyUpdatesValueBindingOption
because it makes editing operations very slow.)