我正在使用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呢?