如何从代码启动应用程序的FinderSync扩展? [英] How to launch app's FinderSync Extension from code?
本文介绍了如何从代码启动应用程序的FinderSync扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用当我直接从Xcode启动它时,它会显示在finder中.但是当我运行主应用程序时它是不可见的.有什么办法可以针对沙盒应用程序做到这一点?在未使用沙盒的应用中,我使用了以下代码:
It displays in finder when I launch it directly from Xcode. But it is not visible when I run the main app. Is there some way to do it for sandbox app? In not sandboxed app I used the code:
NSTask *fseEnable = [[NSTask alloc] init];
fseEnable.launchPath = @"/usr/bin/pluginkit";
fseEnable.arguments = @[@"-e", @"use", @"-i", @"com.team.AppName.FinderSyncExtension"];
[fseEnable launch];
但是它不适用于沙盒.我试过了:
But it does not work for sandboxed. I tried:
[[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:@"com.team.AppName.FinderSyncExtension" options:NSWorkspaceLaunchDefault additionalEventParamDescriptor:nil launchIdentifier:nil];
但是它也不起作用.
可能在项目设置中有一些复选框可以做到这一点.但我没有喜欢.
Probably there is some checkbox in project settings to do it. but I haven't fond it.
查看全文