【发布时间】:2014-05-24 11:29:25
【问题描述】:
我的苹果沙盒和我的应用程序的功能有问题。该应用程序应该让我的 Mac 进入睡眠状态,或者关闭或重新启动它。我使用“com.apple.security.temporary-exception.apple-events”作为值为“com.apple.finder”的沙盒的权利。我已经导入了 ScriptingBridge 并生成了一个 Finder.h 文件,我也将它包含在我的项目中,就像它在 https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/UsingScriptingBridge/UsingScriptingBridge.html#//apple_ref/doc/uid/TP40006104-CH4-SW12 中提出的一样。
然后我尝试使用 Finder.h 提供的方法,例如关闭、重新启动或睡眠,但它们不起作用。
FinderApplication *theFinder = [SBApplication applicationWithBundleIdentifier:@"com.apple.finder"];
[theFinder shutDown];
谁能告诉我如何在沙盒应用中实现这些功能?
非常感谢!
【问题讨论】:
-
您是否在控制台上收到任何消息?你的
theFinder是零吗?您进行了哪些诊断? -
如果您的应用要部署在 Mac App Store 中,您将无法通过临时例外中的 com.apple.finder 获得批准。另见stackoverflow.com/questions/21975699/…
标签: macos cocoa sandbox shutdown entitlements