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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -