Q: Why are my menu items disabled in the Recent Searches menu of NSSearchField ?A: You are probably not providing an action selector to your menu items. When you add Search Categories to the Recent Searches menu, you are responsible for providing the "action" selector. Here is how you would programatically build a menu item to be added: Listing 1: Example menu item
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:@"Client Search"
action:@selector(clientSearchAction:)
keyEquivalent:@""];
If you are using Interface Builder to configure your Recent Searches menu, you must connect the menu item to the appropriate action selector in your controller object. For a complete code example, refer to: Introduction to Search Fields: Configuring a Search Menu Document Revision HistoryDate | Notes |
---|
2006-11-27 | First Version |
Posted: 2006-11-27
|