Get NSButton that you want to behave differently. Change its purpose and action. (To go to the original goal / action, save them before changing them.)
NSAlert *alert = ...; NSButton *button = [[alert buttons] objectAtIndex:...]; id oldTarget = [button target]; SEL oldAction = [button action]; [button setTarget:self]; [button setAction:@selector(verifyCredentials:)];
Alternatively, you can create an alert as a custom window controller and XIB (as Apple did in the case of the App Store). In this case, you have small-scale control over the behavior of the buttons.
source share