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
Just change the action of this menu item to another one that you provide, which opens a web browser using -[NSWorkspace openURL:] .
-[NSWorkspace openURL:]
namely:
- (void)showHelp:(id)sender { NSURL * helpFile = [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"html"]; [[NSWorkspace sharedWorkspace] openURL:helpFile]; }