How can I create a document-based application that cannot create a new document?
问题 I have a document-based application that is designed to process existing documents, not to create new documents. How do I prevent the application from creating a new, blank document when launched by opening it from the Finder? 回答1: There is an NSApplication delegate protocol method you can implement. - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender { return NO; } Here's the documentation 回答2: Depending on what you are specifically doing, you might want to override newDocument