Dilshan
Dilshan

Reputation: 3221

Cocoa - customize help menu item

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

Answers (2)

Kappe
Kappe

Reputation: 9495

exactly:

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

Upvotes: 9

millenomi
millenomi

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

Related Questions