The document object associated with the main window.
SDK
- macOS 10.0+
Framework
- App
Kit
Declaration
var currentDocument: NSDocument? { get }
Discussion
The value of this property is nil
if it is called when the app is not active. This can occur during processing of a drag-and-drop operation, for example, in an implementation of read
. In such a case, send the following message instead from an NSView
subclass associated with the document:
[[[self window] windowController] document];