• 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: Avoid creating a new document when launching an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoid creating a new document when launching an application


  • Subject: Re: Avoid creating a new document when launching an application
  • From: m <email@hidden>
  • Date: Sat, 15 Oct 2005 15:47:44 -0700


On Oct 15, 2005, at 1:45 PM, email@hidden wrote:


I have a Document-based application (NSPersisentDocument to be precise) for
which I would like to override the default behavior when launching: I'd like to
avoid creating a new blank document (for example by displaying an open dialog).



Add this method to your app's delegate.

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
{
[[NSDocumentController sharedDocumentController] performSelector:@selector(openDocument:) withObject:self afterDelay: 0.1];
return NO;
}



_murat

_______________________________________________
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


References: 
 >Avoid creating a new document when launching an application (From: email@hidden)

  • Prev by Date: Re: Warning: "initialization from distinct Objective-C type". What does it mean?
  • Next by Date: Re: Webview and databases
  • Previous by thread: Re: Avoid creating a new document when launching an application
  • Next by thread: Re: Odd tooltip behavior in NSTableView
  • Index(es):
    • Date
    • Thread