I need to open safari to the help event in my cocoa application. We can customize the help menu item as this.
http://cocoadevcentral.com/articles/000072.php
But I need to open the the browser to this event. Please help me.
Thank you
exactly:
- (void)showHelp:(id)sender
{
NSURL * helpFile = [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"html"];
[[NSWorkspace sharedWorkspace] openURL:helpFile];
}
Just change the action of that menu item to another one you provide that opens the web browser with -[NSWorkspace openURL:]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With