• 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: Stopping the new document at launch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stopping the new document at launch


  • Subject: Re: Stopping the new document at launch
  • From: email@hidden
  • Date: Thu, 21 Feb 2002 16:50:36 -0800

This is probably an easy question to answer, but one I've had a hard time
searching for...
How do you stop an application from automatically opening a new document
when you
1) launch it and also
2) switch to it from the doc?

See NSApplication's doc, specifically the delegate methods applicationShouldOpenUntitledFile: and applicationShouldHandleReopen:hasVisibleWindows:. They should do what you need. Set up an application delegate, if you don't already have one (I typically instantiate one in the main nib of my application, and hook it up directly in IB to be the delegate of the File's Owner, which is the NSApplication instance in most projects). Then just implement these methods to do whatever you want. Good luck.

Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Changing "MyDocument" to another class
  • Next by Date: Re: RFC: How to communicate with Addressbook
  • Previous by thread: Re: Stopping the new document at launch
  • Next by thread: Help needed with fonts
  • Index(es):
    • Date
    • Thread