I am dynamically creating a menu based on an array, and there is a submenu associated with IBAction that opens a folder in Finder. The opened folder is based on the property of the object in my initial array.
Is there a way to associate an NSMenuItem action with an IBAction and pass in this directory variable as I dynamically create this array?
OR should I go to IBAction and resolve the directory, referencing NSMenuItem as an array?
eg.
person = [[Person alloc] init]; // person is assigned subMenu = [[NSMenu alloc] init]; [subMenu addItemWithTitle:@"Open folder" action:@selector(openDirectory:person.directory) keyEquivalent:@""];
source share