objective c - NSDocument isDocumentEdited and undo -
in document-based application, every user action add entry in undomanager, including selection, meaning 'undo' restore previous selection.
some times user open document, view items selecting them , close document, if user didn't 'alter' anything, user asked save changes, annoying , can misleading user.
it seems document's dirty flag (isdocumentedited) automatically set when registering undo actions, there way can prevent particualr undoable actions, such selection change?
thanks!
you should able call -setactionisdiscardable:yes
on undomanager when register actions don’t need saved.
Comments
Post a Comment