• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDocument newbie
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument newbie


  • Subject: Re: NSDocument newbie
  • From: James Bucanek <email@hidden>
  • Date: Tue, 26 Jul 2005 18:11:20 -0700

John Stiles wrote on Tuesday, July 26, 2005:

>Now I have another NSDocument question. Instead of having my app open
>up with a meaningless blank document, I'd like for it to start up
>showing the Open dialog. How can I do this? Or at the very least, how
>can I make the empty document at startup go away?

To stop NSApp from trying to create a new window when the application is launched, define

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication*)sender

in your application delegate and just return NO.

My application doesn't prompt for an open dialog when it is opened, but I image that you could catch applicationDidFinishLaunching: and call, or queue up a call to, openDocument:.

--
James Bucanek <mailto:email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSDocument newbie
      • From: John Stiles <email@hidden>
References: 
 >Re: NSDocument newbie (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Custom line breaking in NSTextView
  • Next by Date: Re: NSDocument newbie
  • Previous by thread: Re: NSDocument newbie
  • Next by thread: Re: NSDocument newbie
  • Index(es):
    • Date
    • Thread