When I have a process that I really don't want running more than once (some people will run copies or use LaunchServices to launch multiples) I register a named mach port with NSConnection. When when an instance launches it checks for that connection and if it exists the new instance exits out after displaying an error.

Just one method to use, but beware that the bootstrap server limits what sessions can see registered ports. But it will work to keep the same user from opening multiple instances.

Other methods are creating a device to check for, a shared memory page, ect.


On 22 Feb 2010, at 05:59, Poonam Virupaxi Shigihalli wrote:


Hi list,

Is there a way to check an application instance is running. I tried enabling application prohibits multiple instance in info.plist.
Still i am able to launch multiple instance of the same application.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to