Is there a way I can I know if a document is locked or not? (I mean the string that appears in the title bar of a document based app in Cocoa, see picture)
I’ve been trying with -[NSDocument isInViewingMode] but it always returns NO 🙁 and been reading this thread without much success so far …

To my understanding, there are three cases to check for:
The first two you have to check for yourself. But the latter can be achieved by calling
-checkAutosavingSafetyAndReturnError: