On Oct 13, 2008, at 9:45 PM, XiaoGang Li wrote:

    I have a cmd-line application and also a GUI application, when
cmd-line app get specified information from low-level service, it will
launch the GUI app to tell user that something happens. but the low- level service maybe send the specified info multiple times. so if the GUI app is running, the cmd-line should not launch it again, I means there should not
have two same GUI app running in the front at the same time.
SO, my question is that what cmd-line should do? how to check this case? can someone give me some point. I have no idea about this even no key words
to google it. thanks very much.

The command-line app should be using Launch Services (rather than NSTask or fork+exec) to launch the GUI app. By default, Launch Services won't launch two instances of the app, so you get the behavior you're looking for "for free".

Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [EMAIL PROTECTED]

Reply via email to