NSAppleEventManager. , AppKit , OS X - , URL .. UIKit . Apple.
: applicationWillFinishLaunching:
-(void)applicationWillFinishLaunching:(NSNotification *)aNotification {
NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager];
[appleEventManager setEventHandler:self
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass andEventID:kAEGetURL];
}
- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
NSString *urlAsString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
... do something ...
}
Info.plist.