According to this page, the function LSOpenApplication
has been deprecated since OS X v10.10
. The proposed alternative is to use -[NSWorkSpace launchApplicationAtURL]
instead. Unfortunately, I'm writing a user agent in C++ that has to launch a GUI application written in Cocoa. This means that I do not have access to Cocoa functions (including the aforementioned alternative).
What other function could I use to help me do this that is not marked as deprecated?
Thanks in advance.
You can open an application using
LSOpenCFURLRef()
with the URL of the application you want to open. Similarly, you can useLSOpenFromURLSpec()
with anLSLaunchURLSpec
with the URL of an application in theappURL
field.