ios帮助文档

Concepts

  • Apple Help Programming Guide
  • Help Viewer
  • Help Books
  • How Users Access Your Help
  • The Library Menu: The Library menu lists all of the help books currently registered on the user’s system. A help book is registered when an application calls the AHRegisterHelpBook function during application startup or (if the help book is listed in the application’s Info.plist file) when the user chooses application help from the Help menu or from a help button.
  • Organizing the Help Book Bundle: Reference
    • When your help book is bundled with your software, it is installed and moved along with your software.
    • For Cocoa and Java applications, you can take advantage of automatic help book registration by adding the help book name and location to your information property list (Info.plist) file.

Step by step

  1. Create the Help Book Bundle Reference with the structure shown bellow and with the following items. The minimum items are: Info.plist and index.html
  2. Create Help Title Page. Reference Sample is bellow.
  3. Optionaly specify a Help Book Icon. Reference
  4. Create the help Info.plist File Reference Sample is bellow.
  5. Optionaly create other Help Bundle items: Authoring Apple Help:
    • Navigation Pages
    • Title Page
    • Help Book Icon
    • Indexing Your Help Book
    • Opening an External Web Page in Help Viewer
    • Using Help URLs in Your Help Book
    • Automating Help Tasks with AppleScript
    • Generating Lists from Anchors
    • Localizing Your Help Book
  6. Add Help folder to your project/application Reference

    PRECONDITION: your Help bundle is already created.

    • In the main project window, select Resources in the Groups & Files pane.
    • From the Action menu, choose Add > Existing files
    • Select the help bundle in the Add Files dialog and click Add.
    • Select the “Create Folder References for any added folders” radio button and click Add
    • CAUTION: If you neglect to perform this step, your help book will work as expected on your development system, but will not work when you transfer the help book to another system.
    • INFO: it is OK with the bundle is shown in the Project Browser as single file even though it is a folder with lots of files.
  7. Register Help Book Reference
    • WHY REGISTER: When you register your help book, the system creates a Help menu for your application, populates it with an application help item, and opens your help book when a user chooses this item. In addition, your help book must be registered for it to appear in the Library menu.
    • HOW TO REGISTER: include the CFBundleHelpBookFolder and CFBundleHelpBookName keys in your Info.plist file, for example:<key>CFBundleHelpBookFolder</key> <string>_PRODUCT_NAME_.help</string> <key>CFBundleHelpBookName</key> <string>com.__COMPANY__._PRODUCT_NAME_.help</string>

Quick Reference

Help Bundle Structure

_PRODUCT_NAME_.app/
    Contents/
        Resources/
            _PRODUCT_NAME_.help/

_PRODUCT_NAME_.help/
    Contents/
        Info.plist
        Resources/
            shrd/                   <shared artwork>
            English.lproj/
                index.html  <title page>
                search.helpindex
                ExactMatch.plist    <see “Setting Up Exact Match Searching”>
                InfoPlist.strings   <localized values for Info.plist>
                pgs/                <the rest of the content pages>
                gfx/                <localized artwork>
                sty/                <style sheets, generated list template>
                scrpt/              <scripts>

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__._PRODUCT_NAME_.help</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>_PRODUCT_NAME_</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>hbwr</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>HPDBookAccessPath</key>
    <string>index.html</string>
    <key>HPDBookIconPath</key>
    <string>_PRODUCT_NAME__icon.png</string>
    <key>HPDBookIndexPath</key>
    <string>search.helpindex</string>
    <key>HPDBookKBProduct</key>
    <string>_PRODUCT_CODENAME_</string>
    <key>HPDBookKBURL</key>
    <string>_PRODUCT_URL_</string>
    <key>HPDBookRemoteURL</key>
    <string>_PRODUCT_URL_</string>
    <key>HPDBookTitle</key>
    <string>_PRODUCT_NAME_ Help</string>
    <key>HPDBookType</key>
    <string>3</string>
</dict>
</plist>

index.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>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="robots" content="noindex" />
        <title>_YOUR_HELP_TITLE_</title>
        <meta name="AppleTitle" content="_YOUR_HELP_TITLE_" />
        <meta name="AppleIcon" content="_PRODUCT_NAME__icon.png" />
    </head>
    <body>
This is where the help text comes.
    </body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值