NSAlert

作者: 皮蛋豆腐酱油 | 来源:发表于2019-10-25 15:02 被阅读0次
        NSAlert *alert = [[NSAlert alloc] init];
        alert.icon = nil;
        //增加一个按钮
        [alert addButtonWithTitle:@"OK"];//1000
        //提示的标题
        [alert setMessageText:@"标题"];
        //提示的详细内容
        [alert setInformativeText:@"内容"];
        //设置告警风格
        [alert setAlertStyle:NSAlertStyleInformational];
    
        //开始显示告警
        [alert beginSheetModalForWindow:self.win
                      completionHandler:^(NSModalResponse returnCode){
                          //用户点击告警上面的按钮后的回调
                          NSLog(@"returnCode : %d",returnCode);
                      }
         ];
    

    https://blog.csdn.net/lovechris00/article/details/78024688

    相关文章

      网友评论

          本文标题:NSAlert

          本文链接:https://www.haomeiwen.com/subject/cgisvctx.html