Skip to content

Instantly share code, notes, and snippets.

@chamerling
Created December 12, 2011 11:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamerling/1466628 to your computer and use it in GitHub Desktop.
Save chamerling/1466628 to your computer and use it in GitHub Desktop.
OS X URL handler
- (void)registerURLHandler:(id) sender
{
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
OSStatus httpResult = LSSetDefaultHandlerForURLScheme((CFStringRef)@"quickhubapp", (CFStringRef)bundleID);
NSLog(@"Result : %@", httpResult);
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(getUrl:) forEventClass:kInternetEventClass andEventID:kAEGetURL];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment