我已经复查了一切,并希望有人可以找到我没有看到的一个愚蠢的错误。帮助簿中的锚不起作用
我正在尝试为我的应用程序构建一个Apple帮助部分,并且它正确转到了着陆页,但是没有任何锚点工作。着陆页被称为index.html
,另一页被称为test.html
,它位于pgs
目录中。
index.html中我有:
<a href="help:anchor=support bookID=com.company.app_name.help">Link to another page</a>
在test.html的,我有:
<a name="support"></a>
因此,这里是我遵循为了得到我现在在那里的步骤:
1)I建目录由Apple documentation
AppName.help/
Contents/
Info.plist
Resources/
shrd/
English.lproj/
index.html
search.helpindex
pgs/
test.html
指定
2)我构建了Apple文档中指定的Help Info.plist。包含在Info.plist中,我将CFBundleIdentifier
设置为com.company.app_name.help
。
3)在我的应用程序的Info.plist我设置CFBundleHelpBookFolder
到AppName.help
并设置CFBundleHelpBookName
到com.company.app_name.help
4)然后我抄,我内置的Xcode同时确保我所选择的选项创建文件夹参考文献目录对于任何添加的文件夹。
5)然后我用帮助索引器索引目录AppName.help
。确保我选择所有文件中的索引锚点信息。然后将.helpindex文件复制到它应该是的 English.lproj文件夹中。
就是这样。如果我在 index.html文件中将以下链接放置正确,我注意到我的应用程序有几件事。
<a href="pgs/test.html">Click this link</a>
另外这里是我的的index.html代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AppName Help</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex" />
<meta name="AppleTitle" content="AppName Help" />
<meta name="AppleIcon" content="../shrd/icon.png" />
</head>
<body>
<a href="help:anchor=support bookID=com.company.app_name.help">Link to another page</a>
</body>
下面是 test.html文件的代码。
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing Links</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="anchors" />
</head>
<body>
<a name="support"></a>Does linking work?<br/>
</body>
</html>
这是我的帮助文件的Info.plist。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en_us</string>
<key>CFBundleIdentifier</key>
<string>com.company.app_name.help</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AppName</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2</string>
<key>CFBundleSignature</key>
<string>hbwr</string>
<key>CFBundleVersion</key>
<string>2</string>
<key>CFBundleHelpBookName</key>
<string>AppName Help</string>
<key>HPDBookAccessPath</key>
<string>index.html</string>
<key>HPDBookIconPath</key>
<string>shrd/icon.png</string>
<key>HPDBookIndexPath</key>
<string>search.helpindex</string>
<key>HPDBookKBProduct</key>
<string>app_name1</string>
<key>HPDBookKBURL</key>
<string>http://www.company.com</string>
<key>HPDBookRemoteURL</key>
<string>http://www.company.com</string>
<key>HPDBookTitle</key>
<string>AppName Help</string>
<key>HPDBookType</key>
<string>3</string>
</dict>
</plist>
而且我跟着这个帖子:http://www.cocoabuilder.com/archive/cocoa/312037-updating-an-app-help.html每次我做另外一个变化重新索引目录的时间来清除高速缓存。
谢谢大家!
很好地概述了问题。我同意这个主题隐约涵盖。你找到解决方案吗?如何回答你自己的问题(如果你能记得6个月前)? – David 2013-09-02 00:38:54