Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8898841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:42:50+00:00 2026-06-15T00:42:50+00:00

OS X, Why is Help NSMenuItem in mainMenu disabled after registering the Help Book

  • 0

OS X, Why is Help NSMenuItem in mainMenu disabled after registering the Help Book

Tags: OSX, HelpBook, NSMenuItem, AHRegisterHelpBookWithURL

The HelpBook is unusable because the Help menu is disabled.
When the Help Menu is selected, the Help sub menu appears this way:

    Spotlight Search searchBar here - BLUE
    HungryMe Help  - GREYED OUT

The MainWindow.nib contains the Menu. The Help Menu Item is enabled in Xcode.

THE HELP BOOK

The HelpBook Info.plist follows;

    <?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.DrummingGrouse.HungryMe.help</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>HungryMe</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></string>
        <key>HPDBookIconPath</key>
        <string>shrd/EyeOnly.png</string>
        <key>HPDBookIndexPath</key>
        <string></string>
        <key>HPDBookKBProduct</key>
        <string></string>
        <key>HPDBookKBURL</key>
        <string></string>
        <key>HPDBookRemoteURL</key>
        <string></string>
        <key>HPDBookTitle</key>
        <string>HungryMe Help</string>
        <key>HPDBookType</key>
        <string>3</string>
    </dict>
    </plist>

The test Title Page, HungryMe.html, follows:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" AppleTitle="com.DrummingGrouse.HungryMe.help" />
    <title>HungryMe</title>
    </head>
    <body>
    <a name="hungryme_page"></a>
    <div class="container">
    <p>This is some text. <img src="../shrd/EyeOnly.png"  align="middle"> This is some more text.</p>
      <div class="content">
         <h1>Getting Started - Cooking with HungryMe</h1>
         <p>HungryMe has a main window with Category elements on the left and Recipe elements on the right.</p>
         <p>The display of a recipe's details is done as follows:</p>
         <p>    1. Select a recipe Category in the left table of the main window. Select &quot;Browse All&quot; if you wish to have all recipes to be listed.</p>
         <p>2. Double click the desired recipe and a separate window will appear displaying the details for the selected recipe. Multiple recipes can be displayed simultaneously.</p>
      <!-- end .content --></div>
      <!-- end .container --></div>
    </body>
    </html>

The App’s Info.plist has:

CFBundleHelpBookFolder HungryMe.help
CFBundleHelpBookName com.DrummingGrouse.HungryMe.help

The Apple Help Programming Guide has:

    The CFBundleHelpBookName key identifies the help book. The value associated with this key 
    should be a string specifying the help book title, as defined by the AppleTitle tag in the 
    title page of the book. For example, here is how you would enter the title 
    of the SurfWriter Help book:

    <key>CFBundleHelpBookName</key>
    <string>com.mycompany.surfwriter.help</string>

The Help Book bundle, HungryMe.help, is added to the Xcode project’s Resources/ folder.
The Bundle is structured this way:

    HungryMe.help/
        Contents/
            Info.plist
            Resources/
                shrd/ <shared artwork>
                English.lproj/
                    HungryMe.html <title page>
                    pgs/ <the rest of the content pages>
                    gfx/ <localized artwork>
                    sty/ <style sheets, generated list template>
                    scrpt/ <scripts>

The Help Menu Item that would display the HelpBook is greyed out whether or not the
Help Book is registered using AHRegisterHelpBookWithURL.

If AHRegisterHelpBookWithURL is used, the err returned in code below is Zero.

    OSStatus RegisterMyHelpBook(void)
    {
        CFBundleRef myApplicationBundle;
        CFURLRef myBundleURL;
        OSStatus err = noErr;

        myApplicationBundle = NULL;
        myBundleURL = NULL;

        myApplicationBundle = CFBundleGetMainBundle();// 1
        if (myApplicationBundle == NULL) {err = fnfErr; return err;}

        myBundleURL = CFBundleCopyBundleURL(myApplicationBundle);// 2
        if (myBundleURL == NULL) {err = fnfErr; return err;}

        if (err == noErr){
            err = AHRegisterHelpBookWithURL(myBundleURL);// 3
        }

        return err;
    }

The following code, executed at launch time,

NSMenu *mainMenu = [[NSApplication sharedApplication] mainMenu];
NSMenuItem *menuItemHelp = [mainMenu itemWithTitle:@"Help"];
NSMenu *menuHelp = [menuItemHelp submenu];
NSMenuItem *menuItemHelpHungryMe = [menuHelp itemAtIndex:0];
DLog(@"menuItemHelpHungryMe=%@",menuItemHelpHungryMe);
DLog(@"menuHelp=%@",menuHelp);

Produces the following output.

2012-11-16 11:30:03.167 HungryMe[62153:303] -[AppDelegate applicationDidFinishLaunching:]
   menuItemHelpHungryMe=<NSMenuItem: 0x1b6e3c0 HungryMe Help>
2012-11-16 11:30:03.168 HungryMe[62153:303] -[AppDelegate applicationDidFinishLaunching:]
   menuHelp=<NSMenu: 0x1b6e3a0>
Title: Help
Supermenu: 0x1b6c8e0 (MainMenu), autoenable: YES
Items:     (
    "<NSMenuItem: 0x1b6e3c0 HungryMe Help>"
)

I observed that menuHelp above has only one item.

The Help Menu Item titled “HungryMe Help” is greyed out regardless of whether or not the Help Menu
is enabled in the NIB .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:42:51+00:00Added an answer on June 15, 2026 at 12:42 am

    I deleted the Help Menu Item from the NIB file and then re-added it in Xcode. The Help Menu then became enabled for reasons I don’t understand. The following code made the Help Viewer appear:

    - (IBAction) showHelp:(id)sender {
        int status =  MyGotoHelpPage();
        DLog(@"status for HelpBook load is %d",status);
    }
            
    OSStatus MyGotoHelpPage (void) {
        CFBundleRef myApplicationBundle = NULL;
        CFStringRef myBookName = NULL;
        OSStatus err = noErr;
                
        myApplicationBundle = CFBundleGetMainBundle();// 1
        //if (myApplicationBundle == NULL) {err = fnfErr; goto bail;}// 2
        myBookName = CFBundleGetValueForInfoDictionaryKey( myApplicationBundle,                                                                            CFSTR("CFBundleHelpBookName"));                                                                    
        if (myBookName == NULL) {err = fnfErr; return err;}
                
        if (CFGetTypeID(myBookName) != CFStringGetTypeID()) {// 4
            err = paramErr;
        } 
                
        err = AHGotoPage (myBookName, NULL,NULL);// load title page
        return err;
    }
    

    The Help Viewer appears with a message: "The selected topic is currently unavailable."
    This is progress.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Help me please. I have problem with encoding response string after GET request: var
Help me understand this piece of code - After the first iteration the value
Help. This don't work after it set menuInput. It always just go to :opties.
Help me with my code, because i don't now how to do this simple
Help please, After numerous hours searching for the solution to my problem i have
I would like to have help about binding a function to NSMenuItem. I have
Help me to avoid getting Unnecessary focus. I disabled focus, but I don't know
Help, I'm deperate..i can't continue my app because of this: I have setup one
Help me translate following block of the Haskell code. The run function produces text
Help please on how to extract data like 15,Teaching Periods 1 and 2.,Max 150.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.