Skip to content

Instantly share code, notes, and snippets.

@dystonie
Created August 20, 2012 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dystonie/3403741 to your computer and use it in GitHub Desktop.
Save dystonie/3403741 to your computer and use it in GitHub Desktop.
Alert Dialog
NSAlert *alert = [NSAlert alertWithMessageText:@"Text" defaultButton:@"OK" alternateButton:@"Cancel" otherButton:nil
informativeTextWithFormat:@"%@",someLocalizedVariable];
[alert beginSheetModalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil];
//didEnd:
-(void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
if (returnCode == NSAlertDefaultReturn) {
//Dialogo Risposta
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment