开发者

Cocoa - customize help menu item

开发者 https://www.devze.com 2023-02-12 19:27 出处:网络
I need to open safari to the help event in my cocoa application. We can customize the help menu item as this.

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

精彩评论

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