Skip to content

Instantly share code, notes, and snippets.

@cppforlife
Created September 16, 2012 08:12
Show Gist options
  • Save cppforlife/3731529 to your computer and use it in GitHub Desktop.
Save cppforlife/3731529 to your computer and use it in GitHub Desktop.
menu items for NSApp
- (void)_listMenuItems {
NSMenu *mainMenu = [[NSApplication sharedApplication] mainMenu];
for (NSMenuItem *item in [mainMenu itemArray]) {
NSLog(@"Menu %@:", [item title]);
for (NSMenuItem *subitem in [item.submenu itemArray]) {
NSLog(@"\t%@\n\t\t%@ - %@ - %@\n",
[subitem title],
NSStringFromSelector([subitem action]),
subitem.target,
subitem.representedObject);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment