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
}
這是工作,但有可能我每次打電話的時候不要把前面的應用定製方案?