Reputation: 3221
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
Upvotes: 6
Views: 2166
Reputation: 9495
exactly:
- (void)showHelp:(id)sender
{
NSURL * helpFile = [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"html"];
[[NSWorkspace sharedWorkspace] openURL:helpFile];
}
Upvotes: 9
Reputation: 6589
Just change the action of that menu item to another one you provide that opens the web browser with -[NSWorkspace openURL:]
.
Upvotes: 7