ApplicationShouldOpenUntitledFile returns NO, but the application still opens empty documents

I do not understand how to stop a document-based application from displaying an empty document at startup.

In a previous question I posted, someone said: "Are you sure that the window delegate is configured correctly and is not nil?"

Can someone clarify? It seems that the Window object in the MyDocument nib is by default associated with the file owner / delegate. What else do I need to do? Since it is standing, it is not working.

This method is located in MyDocument.m in the project structure. Do I need extra code?

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender  
{
    return NO;
}
+3
source share
1 answer
+5

All Articles