2011-05-03 24 views

回答

1

您似乎应该能够通过launchAppWithBundleIdentifier:calls的additionalEventParamDescriptor参数发送Apple事件,然后在您的应用程序中接收该事件,以便您知道这是您的代理启动您。

+2

谢谢。我找到了接受的方式。在我的应用程序委托我写了以下方法:' - (BOOL)applicationShouldOpenUntitledFile :(NSApplication *)sender { \t NSAppleEventDescriptor * event = [[NSAppleEventManager sharedAppleEventManager] currentAppleEvent]; (事件) \t \t如果(事件) \t AEEventID evtID = [event eventID]; \t \t \t 如果\t(事件&&(evtID == kAEOpenApplication)&& [事件事件类] == kCoreEventClass) \t \t { \t \t \t //这里一些代码 \t \t \t} \t} \t返回YES ; }' – Raviprakash 2011-05-10 09:52:09

+0

太好了。我不确定你会如何收到它,但听起来你已经知道了! – 2011-05-15 23:25:31

相关问题