NSAppleEventManager を使用して Apple イベント ハンドラーを登録しています。
[[NSAppleEventManager sharedAppleEventManager]
setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass andEventID:kAEGetURL];
もちろん、私のハンドラー メソッドはイベントと応答イベントを受け取ります。
- (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent {
//Open this URL; reply if we can't
}
では、何らかの方法でこの URL を開くのに失敗したことを示すエラーで返信する必要がある場合、どのように を使用すればよいreplyEvent
でしょうか?