nsrunalertpanel snippets

How to display a modal dialog with Objective-C and Cocoa

Tagged objective-c, cocoa, modal, dialog, nsrunalertpanel  Languages objectivec
int choice = NSRunAlertPanel(@"title", @"description", @"DEFAULT", @"ALTERNATE", "OTHER", 8);
    
if(choice == NSAlertDefaultReturn)        

} else if(choice == NSAlertOtherReturn) {

} else if(choice == NSAlertAlternateReturn) {

}