Can't update Help Book in XCode 9

Discussion in 'Mac Programming' started by Senor Cuete, Sep 20, 2017.

  1. Senor Cuete macrumors regular

    Joined:
    Nov 9, 2011
    #1
    It has always been a hassle to get XCode to update the an application's Help Book. In the past I have been able to get it done by following these instructions:

    Delete any other versions and empty the trash.
    Update the About app.html, version and copyright
    Update the Help.plist
    Create a new Help.helpindex using the help indexer
    Remove the help folder from project.
    Delete the system’s cached help folder using the terminal command:
    rm -rf ~/Library/Caches/com.apple.help*
    Clean and rebuild the project without the Help folder
    Add the new Help folder, clean and rebuild
    Check to be sure that the new help book is added
    You might have to restart your machine

    Now this doesn't work. When I run my project with the new Help Book the Help Book window says:

    The selected topic is currently unavailable.
    The topic you were trying to view could not be found.

    XCode logs:

    2017-09-20 13:45:49.466114-0600 app[2349:187674] Entering AHRegisterHelpBookWithURL
    2017-09-20 13:45:49.466228-0600 app[2349:187674] Entering AHRegisterHelpBookWithURL: 0
     
  2. Senor Cuete thread starter macrumors regular

    Joined:
    Nov 9, 2011
    #2
    A post on Stack overflow says to do execute more terminal commands.:

    rm -rf ~/Library/Caches/com.apple.help*
    rm -rf ~/Library/Preferences/com.apple.help*
    rm -rf ~/.Trash/*

    Also I trashed the cached versions of the app in:

    username>Library>Developer>XCode>Derived Data>appname-(long text of goblygook).Build.Products>Debug>App
    and ... > Release.

    Then I re-started my Mac.

    I also tried to archive the app and then export it.

    I doesn't help.
    --- Post Merged, Sep 21, 2017 ---
    I also read the Apple Help Programming Guide - How to register Your Help Book.
    CFBundleHelpBookFolder and CFBundleHelpBookName strings are correct and they haven't changed since I started to have this problem.
     
  3. 25ghosts macrumors regular

    Joined:
    Jan 31, 2008
    #3
    Even worse the app is totally missing ALL its guide inside the Documentation Browser.
    This has to be the greatest oversight in Xcode History !
     
  4. Senor Cuete thread starter macrumors regular

    Joined:
    Nov 9, 2011
    #4
    I read the Bundle Programming Guide and the Help Programming Guide and compared my .plists side by side to the guides. The Info.plists are EXACTLY as they are in the guides.

    The first paragraph of the Apple Help Programming Guide - Help Book Registration section says that you can register your Help Book by calling AHRegisterHelpBook. You actually can't do this because this is a Carbon function. Carbon is 32-bit and it won't link in a 64-bit Cocoa project.

    You can try to register your help Book manually by doing this:
    Code:
    BOOL yesOrNo = [[NSHelpManager sharedHelpManager] registerBooksInBundle: [NSBundle mainBundle]];
    This will return YES, but the help Book won't be available.
     
  5. Senor Cuete thread starter macrumors regular

    Joined:
    Nov 9, 2011
    #5
    The guides are on-line:

    Apple Help Programming Guide:

    https://developer.apple.com/library...nce_intro.html#//apple_ref/doc/uid/TP30000903

    Bundle Programming Guide:

    https://developer.apple.com/library...tual/CFBundles/Introduction/Introduction.html

    I have gone through these with my project open and compared the documentation with my Help Book and .plists and so far I can't register my Help Book. Now I'm opening Application packages and looking at these files to see how they do it.
     
  6. 960design macrumors 68020

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #6
    Are you using pure HTML & text or pulling images ( via HTML/CSS ) from a 'Content' folder. Writing a quick app last week and noticed the drag / drop 'Content' folder over to the project did not actually include the images into the project when checked from the 'Copy Files Over' modal.

    I had to manually select each individual graphic and audio file within the content folder, then:
    Show In The File Inspector > Target Membership ( bottom ) > manually check the item to include it.

    Been reported by many as bug to Apple.
     
  7. Senor Cuete thread starter macrumors regular

    Joined:
    Nov 9, 2011
    #7
    Yes. Including my Help Book folder in a project, being sure that the folder is checked as Target membership - appname. The Help Book Directory Name and Help Book Identifier are correct. XCode 9 WILL NOT MAKE THE HELP BOOK SHOW UP in the app. I have had this in my project for years. Other versions did it but XCode 9 won't.
    --- Post Merged, Sep 25, 2017 ---
    I got it to work. Important:

    1. The help Book authoring guide refers to the Help Book folder as a bundle and shows it in the app bundle hierarchy as a .help bundle DON'T make the Help Book folder a bundle with a .help extension.

    2. When you add the Help Folder to the project, be sure to check the radio button in the add files dialog as " Create Folder references..."

    3. In XCode 9 dragging the help folder into the project won't automatically include it as a member of the target. Highlight the help folder in the project navigator. in the right pane check the Target Membership check box.

    4. Check the strings in the help-Info.plist very carefully. The help-Info.plist strings I had in older versions of the project worked before but not now.
     
  8. 960design macrumors 68020

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #8
    Glad you got it working! I spent a good four hours trying to figure it out after updating to XCode 9.
     
  9. Senor Cuete thread starter macrumors regular

    Joined:
    Nov 9, 2011
    #9
    https://developer.apple.com/library...de/ConfiguringYourApp/ConfiguringYourApp.html

    "The bundle ID string must be a uniform type identifier (UTI) that contains only alphanumeric characters (A-Z,a-z,0-9), hyphen (-), and period (.)."

    So it looks like you could use a help bundle if the name didn't contain a space.
     

Share This Page