0
我处理自定义URL方案像这样AppDelegate.m
:自定义URL方案,而不必应用前面
-(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 * URL = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
//Do my work with URL
}
这是工作,但有可能我每次打电话的时候不要把前面的应用定制方案?