All menuItems are disabled!

Discussion in 'Mac Programming' started by KPForMacRum, Sep 30, 2008.

  1. KPForMacRum macrumors newbie

    Sep 30, 2008
    I am new to Mac and Cocoa programming. So please excuse me. I created a Document application, and see that all menu items under File, Edit etc are disabled. I connected, in MainMenu.nib, them to FirstResponder, and see that they are all connected properly.

    The application menu, which has preferences.. Hide.. etc are also disabled.

    Am I missing something? When I run the application, why are they not enabled? I even tried:

    - (BOOL)validateMenuItem:(NSMenuItem *)item
    return YES;

    and put a break point, but it seems to not even go there. Please help.

    Thank you.
  2. HiRez macrumors 603


    Jan 6, 2004
    Western US
    If you created a Cocoa Document-based application, you shouldn't need to connect most of the default menu items; they are already connected to your document class, and most of them automatically enable or disable themselves based on the document's state. You may have actually broken that connection by trying to connect them to something else.
  3. KPForMacRum thread starter macrumors newbie

    Sep 30, 2008
    Thank you HiRez, very much. That was it. I had those connected in MyDocument as well. They are at a single place, and are working.
    Thank you again.

Share This Page