Skip to content

Instantly share code, notes, and snippets.

@ysmood
Created June 24, 2013 18:45
Show Gist options
  • Select an option

  • Save ysmood/5852409 to your computer and use it in GitHub Desktop.

Select an option

Save ysmood/5852409 to your computer and use it in GitHub Desktop.
Example: Cocoa launch application via path.
+ (void) launchApp:(NSString *)path {
NSURL *url = [NSURL fileURLWithPath:path];
NSError *err = nil;
if ([url checkResourceIsReachableAndReturnError:&err]) {
[[NSWorkspace sharedWorkspace] launchApplication:[url path]];
} else {
NSLog(@"%@", [err localizedDescription]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment