Prevents the user from making further changes to the document.
- macOS 10.8+
The completion handler block object passed in to be invoked after locking is completed, regardless of success or failure of locking.
By default, this method first ensures that any editor who has registered using Cocoa Binding’s NSEditorRegistration informal protocol has committed all changes and then autosaves the document, if necessary, before attempting to lock it using the
lock method. Upon successful locking, the
locked property is set to
[YES]. Documents whose
file property is set to
nil cannot be locked.