Prevent iCloud window from opening on OSX 10.8 app launch

I have written an OSX app that uses iCloud document storage. Whenever I open it in Mountain Lion (not on Lion), an iCloud window opens that looks like the following:

enter image description here

  • NSAttributedString initWithData and NSHTMLTextDocumentType crash if not on main thread
  • CloudKit - no server-side logic?
  • Can't compile code when working with CALayer
  • Unable to add a custom font in Mac app (OSX 10.9+ Xcode5+)
  • What is the basic difference between NSTimer, NSTask, NSThread and NSRunloop?
  • What exactly is a so called “Class Cluster” in Objective-C?
  • Is there a way to prevent this from happening on launch?

    Updates:

    1) applicationShouldOpenUntitledFile: is not getting called (yes, I’m sure I’m listening in my delegate.
    2) If I force quit the app, the next time it opens, I don’t get the dialog. But, if I go through the normal Quit process, it does appear.

    Update 2 (also added as an answer, to help people that may stumble across this question in the future):
    The applicationShouldOpenUntitledFile: from the duplicate question was not working. After lots of experimentation, I figured out that if I remove the NSDocumentClass key and value from my Info.plist in the CFBundleDocumentTypes array, the window is no longer opened. I’ve added that answer to the duplicate question as well.

    Solutions Collect From Internet About “Prevent iCloud window from opening on OSX 10.8 app launch”

    The applicationShouldOpenUntitledFile: from iCloud enabled – Stop the open file displaying on application launch? was not working. After lots of experimentation, I figured out that if I remove the NSDocumentClass key and value from my Info.plist in the CFBundleDocumentTypes array, the window is no longer opened.