gpt4 book ai didi

cocoa - 我应该如何使用帮助 : URL in a Snow Leopard . 帮助包?

转载 作者:行者123 更新时间:2023-12-03 16:26:30 25 4
gpt4 key购买 nike

我正在为我的应用程序编写帮助手册。根据需要,我的应用程序的 info.plist 中有 CFBundleHelpBookName 和 CFBundleHelpBookFolder 键,并且我正在使用新的 Snow Leopard .help bundle 格式作为帮助手册。 Rehearsals.help/Contents/Info.plist 中的各个键均按照 Apple Help Programming Guide 填充。 。正如预期的那样,当用户从“帮助”菜单中选择“排练帮助”时,我的帮助书的索引页(在适当的本地化版本中,目前只有英语)将在帮助查看器中打开。

但是, bundle 中实际上(当前)有两个 HTML 文件:index.html 和 support.html。据我了解,如果我将命名 anchor 放在一个文件中,如下所示:

<a name="support"></a>

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

<a href="help:anchor=support bookID=info.thaesofereode.Rehearsals.help">Support</a>

但是这不起作用。也没有:

<a href="help:anchor=support">Support</a>

帮助查看器显示一个工作表,显示“帮助查看器无法打开此内容。”,如果我在帮助查看器和 helpd 中打开调试日志记录,我会看到以下内容:

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

如何在 Snow Leopard 帮助包中正确使用 help: URL? (不用说,我知道使用相对文件 URL 的解决方法,并且可行,但我希望获得帮助 anchor 来提供上下文帮助和应用程序内的链接。)

最佳答案

事实证明,这些 anchor 和 URL 是正确的,helpd 会自动索引内容,但它会维护积极的缓存。如果更新帮助手册时没有更改版本号,则它不会扫描新的 anchor 。

rm -rf ~/Library/Caches/com.apple.help*
killall helpd

关于cocoa - 我应该如何使用帮助 : URL in a Snow Leopard . 帮助包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2418273/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com