我应该如何使用帮助:Snow Leopard .help包中的URL?

2 cocoa osx-snow-leopard

我正在为我的申请写帮助书.根据需要,我在我的应用程序的info.plist中有CFBundleHelpBookName和CFBundleHelpBookFolder键,我正在使用新的Snow Leopard .help包格式作为帮助手册.Rehearsals.help/Contents/Info.plist中的各种键都按照Apple帮助编程指南填充.正如预期的那样,当用户从"帮助"菜单中选择"排练帮助"时,我的帮助手册的索引页面(在适当的本地化中,当前只有英文版)会在帮助查看器中打开.

但是,实际上(当前)捆绑包中有两个HTML文件,index.html和support.html.我的理解是,如果我将命名锚点放在一个文件中,如下所示:

<a name="support"></a>
Run Code Online (Sandbox Code Playgroud)

然后我可以从其他文件链接到它,如下所示:

<a href="help:anchor=support bookID=info.thaesofereode.Rehearsals.help">Support</a>
Run Code Online (Sandbox Code Playgroud)

然而,这不起作用.也不是:

<a href="help:anchor=support">Support</a>
Run Code Online (Sandbox Code Playgroud)

帮助查看器显示一个表单"帮助查看器无法打开此内容.",如果我打开帮助查看器和帮助中的调试日志记录,我会看到:

10/03/2010 15:46:02 HelpViewer[2049]    decidePolicyForNavigationAction: help:anchor=support%20bookID=info.thaesofereode.Rehearsals.help
10/03/2010 15:46:02 HelpViewer[2049]    decidePolicyForNavigationAction: apple-help-content:help:anchor=support%2520bookID=info.thaesofereode.Rehearsals.help
10/03/2010 15:46:02 HelpViewer[2049]    willSendRequest: <NSMutableURLRequest apple-help-content:help:anchor=support%2520bookID=info.thaesofereode.Rehearsals.help>
10/03/2010 15:46:02 HelpViewer[2049]    Start loading apple-help-content:help:anchor=support%2520bookID=info.thaesofereode.Rehearsals.help
10/03/2010 15:46:02 HelpViewer[2049]    Starting search for query "support" with return port com.apple.helpd-26755
10/03/2010 15:46:02 helpd[2050] PID #2050 - received message #0: HPDStartMessageID
10/03/2010 15:46:02 helpd[2050] Process 2049 requested callback at com.apple.helpd-26755 and sent query: HPDQuery 289928762.026442: "support" in ("info.thaesofereode.Rehearsals.help") of types ("com.apple.HelpArticleResult") with limit 0
10/03/2010 15:46:02 helpd[2050] Run loops which have yet to start: (
    "com.apple.kbPlugin",
    "com.apple.helpbookPlugin"
)
10/03/2010 15:46:02 helpd[2050] Search for this query has been delayed 1 time: support
10/03/2010 15:46:02 helpd[2050] Delayed search for query: "support"
10/03/2010 15:46:02 helpd[2050] Starting help articles search for query: "support"
10/03/2010 15:46:02 helpd[2050] Query 289928762.026442 returned results: (
)
10/03/2010 15:46:02 helpd[2050] Response sent to port: com.apple.helpd-26755
10/03/2010 15:46:02 helpd[2050] Query finished: HPDQuery 289928762.026442: "support" in ("info.thaesofereode.Rehearsals.help") of types ("com.apple.HelpArticleResult") with limit 0
10/03/2010 15:46:02 helpd[2050] Response sent to port: com.apple.helpd-26755
10/03/2010 15:46:02 HelpViewer[2049]    <HVAnchorURLHandler: 0x1002bde50> finished query: HPDQuery 289928762.026442: "support" in ("info.thaesofereode.Rehearsals.help") of types ("com.apple.HelpArticleResult") with limit 0
10/03/2010 15:46:02 HelpViewer[2049]    <HVAnchorURLHandler: 0x1002bde50> has results: {
}
10/03/2010 15:46:02 HelpViewer[2049]    Found no results for support
Run Code Online (Sandbox Code Playgroud)

我如何使用帮助:Snow Leopard中的URL正确帮助捆绑?(毋庸置疑,我知道使用相对文件URL的解决方法,并且可行,但我希望获得帮助锚点,以便在应用程序中进行上下文帮助和链接.)

小智 6

事实证明这些锚点和URL是正确的,并且helpd会自动为内容编制索引,但它会维护一个积极的缓存.如果更新了帮助手册而没有碰到版本号,则它不会扫描新的锚点.

rm -rf ~/Library/Caches/com.apple.help*
killall helpd
Run Code Online (Sandbox Code Playgroud)