Reputation: 63
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
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
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