I just want to add a NSButton with setAction Arguments.
NSRect frame = NSMakeRect(10, 40, 90, 40);
NSButton* pushButton = [[NSButton alloc] initWithFrame:
.tag
should be sufficient if your object have any integer uniqueID..identifier
instead, since it support string based uniqueID.Example:
...
for (index, app) in apps.enumerated() {
let appButton = NSButton(title: app.title, target: self, action: #selector(appButtonPressed))
appButton.identifier = NSUserInterfaceItemIdentifier(rawValue: app.guid)
}
...
@objc func appButtonPressed(sender: NSButton) {
print(sender.identifier?.rawValue)
}