开发者

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 h开发者_开发技巧elp 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:].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜