• 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: Single Instance of a Cocoa Application.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Single Instance of a Cocoa Application.


  • Subject: Re: Single Instance of a Cocoa Application.
  • From: Chris Vetter <email@hidden>
  • Date: Wed, 19 Jul 2006 16:24:29 +0200

On 2006-07-19 16:17:07 +0200 PGM <email@hidden> wrote:
Unlike windows, on a Mac double clicking the Application icon of a running application will simply bring the already running instance to the front. To start two instances of a program, the user must create a copy of the program and run the two different copies. A simple way to check this would be to check a list of running applications at start up and give an alert when another instance of your program is found, though maybe this will not work when the user renames a copy of your program. Search the archives for an example how to do get a list of running apps.

It's probably easier to register the name of the application with NSConnection.


When another instance of the app is being run, it too will try to register, however this should fail (since it already IS registered). You could then pop open an alert panel telling the user that the application is already running.

--
Chris


_______________________________________________ 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
  • Prev by Date: Re: Single Instance of a Cocoa Application.
  • Next by Date: PDEPrint Plugin
  • Previous by thread: Re: Single Instance of a Cocoa Application.
  • Next by thread: Re: Single Instance of a Cocoa Application.
  • Index(es):
    • Date
    • Thread