标签: nsappleeventmanager

回复Cocoa的Apple活动

我正在使用NSAppleEventManager注册Apple事件处理程序:

[[NSAppleEventManager sharedAppleEventManager]
    setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:)
      forEventClass:kInternetEventClass andEventID:kAEGetURL];
Run Code Online (Sandbox Code Playgroud)

当然,我的处理程序方法将接收事件和回复事件:

- (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent {
    //Open this URL; reply if we can't
}
Run Code Online (Sandbox Code Playgroud)

所以,如果我需要回复一个错误,表明我以某种方式打开了这个URL,我应该怎么用replyEvent呢?

macos cocoa appleevents nsappleeventmanager

5
推荐指数
1
解决办法
672
查看次数

标签 统计

appleevents ×1

cocoa ×1

macos ×1

nsappleeventmanager ×1