How do I write entitlements to use NSWorkSpace's showSearchResultsForQueryString in sandboxed app?

家住魔仙堡 提交于 2019-12-02 19:47:48

问题


I have made one sandboxed app which calls NSWorkspace's showSearchResultsForQueryString but this method doesn't work. I guess this error can be associated with entitlement key, but i could't find answer. How can I implement entitlement key for this?


回答1:


That method won't work for a sandboxed app. It sends an Apple event to the Finder.

Have a look at this link in the sandbox design guide:

Determine Whether Your App Is Suitable for Sandboxing

and you'll see the following text:

With App Sandbox, you can receive Apple events and respond to Apple events, but you cannot send Apple events to arbitrary apps.




回答2:


This method can not be used in sandboxed application. Because this method should be fixed to run within sandboxed application in future.



来源:https://stackoverflow.com/questions/11805374/how-do-i-write-entitlements-to-use-nsworkspaces-showsearchresultsforquerystring

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!