I programmatically create an NSMenuItem and it is disabled. If I override the validateMenuItem: method and return YES for all items, the menu item works fine.
Why would it not be enabled when I tell the menu to autoEnableItems and dont override the validateMenuItem: method?
NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:label action:@selector(methodToLogSomething:) keyEquivalent:@""];
menuItem.representedObject = representedObject;
[menuItem setTarget:self];
[menu insertItem:menuItem atIndex:[[menu itemArray] count]-1];
[menuItem release];
[menu setAutoenablesItems:YES];