osx - How to prevent a document-based cocoa application to open ANY document? -


recently, document saved caused crash whenever start app. there way prevent doc-based app opening any document, including new empty or last active document(s)? i'd not using osx functionality (outside scope of app), within program.

i think should done through nsdocumentcontroller somehow, cannot figure out , have had no luck finding answers elsewhere.

so, how tell osx app (through nsdocumentcontroller) not open documents @ startup?

you're looking functionality defined in nsapplicationdelegate-protocol. following 2 methods give control on happens on app start:

- (bool)applicationshouldhandlereopen:(nsapplication *)theapplication hasvisiblewindows:(bool)flag - (bool)applicationshouldopenuntitledfile:(nsapplication *)sender 

see the documentation more.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -