07
Jun
For adding custom buttons on an Alert box use the following code.
NSAlert *alert = [[NSAlert alloc] init];
alert.alertStyle = NSWarningAlertStyle;
[alert addButtonWithTitle:@"YES"];
[alert addButtonWithTitle:@"NO"];
alert.messageText = @”Want to Continue?”;
switch ([alert runModal]) {
case NSAlertFirstButtonReturn:
NSLog (@”YES clicked”);
break;
case NSAlertSecondButtonReturn:
NSLog (@”NO clicked”);
break;
default:
break;
}
[alert release];




