Cocoa - configure help menu item

I need to open safari for the help event in my cocoa application. We can customize the help menu item like this.

http://cocoadevcentral.com/articles/000072.php

But I need to open a browser for this event. Please help me.

thanks

+6
cocoa macos
source share
2 answers

Just change the action of this menu item to another one that you provide, which opens a web browser using -[NSWorkspace openURL:] .

+6
source share

namely:

 - (void)showHelp:(id)sender { NSURL * helpFile = [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"html"]; [[NSWorkspace sharedWorkspace] openURL:helpFile]; } 
+8
source share

All Articles