NSRunalertpanel

时间:2013-01-18 06:48:06

标签: cocoa

我有一个提醒小组说,

NSRunAlertPanel(@"Alert!", @"Do you want to mail your team or raise a Request?", @"Mail", @"Cancel", @"Request");

如果我点击邮件,则应显示邮件窗口,如果我点击请求,则应打开相应的窗口。所以我试过,

    if (NSAlertDefaultReturn){
      [mailWindow showWindow:mailWindow];
    }

    if (NSAlertOtherReturn){
      [reqWindow showWindow:reqWindow];
    }

但是当我点击“请求”时,我打开了两个窗口。我是coc的新手

1 个答案:

答案 0 :(得分:1)

试 NSInteger err = NSRunAlert ...(x,x,x,x,x) 然后错误按下按钮的值 - 1,2或3

相关问题