2016-03-22 NSAlert 12345678910111213NSAlert *alert = [[NSAlert alloc] init]; [alert addButtonWithTitle:@"Continue"]; [alert addButtonWithTitle:@"Cancel"]; [alert setMessageText:@"Alert"]; [alert setInformativeText:@"content"]; [alert setAlertStyle:NSWarningAlertStyle]; [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { if (returnCode == NSAlertFirstButtonReturn) { [[NSApplication sharedApplication] replyToApplicationShouldTerminate:YES]; } else { [[NSApplication sharedApplication] replyToApplicationShouldTerminate:NO]; } }]; Récent AXIsProcessTrustedWithOptions Ancien ios lifecycle event