Skip to content

Instantly share code, notes, and snippets.

@mike3k
Created July 5, 2012 21:34
Show Gist options
  • Select an option

  • Save mike3k/3056612 to your computer and use it in GitHub Desktop.

Select an option

Save mike3k/3056612 to your computer and use it in GitHub Desktop.
Launch parent from login helper
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
NSString *myPath = [[NSBundle mainBundle] bundlePath];
NSLog(@"Helper app at %@",myPath);
for (int i=0; i<4; ++i) {
myPath = [myPath stringByDeletingLastPathComponent];
}
NSLog(@"Launching %@",myPath);
[[NSWorkspace sharedWorkspace] launchApplication: myPath];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment