user3094099
user3094099

Reputation: 63

mac os x invoke calling another application from app

I need to call another application inside my application (Mac OS X app). For example if I have PDF in my bundle and I want to see it call load the PDF in the viewer app. How can call the viewer and load the PDF on bundle?, any of you knows how can I do this?, I'll really appreciate your help.

Upvotes: 0

Views: 666

Answers (2)

San
San

Reputation: 1796

You can invoke, openURL to open the default PDF viewer

[NSWorkspace sharedWorkspace] openFile: pdfFilePath];

and if you want to launch the application you can invoke

[[NSWorkspace sharedWorkspace] launchApplication:appPath];

Want to open PDF within your application then I recommend you to read PDFKit: Apple PDFKit Doc

Upvotes: 1

Nathan Day
Nathan Day

Reputation: 6037

NSWorkspace does this kind of stuff the documentation has near the top the example code

[[NSWorkspace sharedWorkspace] openFile:@"/Myfiles/README"
                        withApplication:@"TextEdit"];

Upvotes: 2

Related Questions