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 use LSOpenFromURLSpec()
with an LSLaunchURLSpec
with the URL of an application in the appURL
field.