Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 是否可以在模型窗口上显示NSAlert/NSAlertPanel_Objective C_Macos_Nsalert - Fatal编程技术网

Objective c 是否可以在模型窗口上显示NSAlert/NSAlertPanel

Objective c 是否可以在模型窗口上显示NSAlert/NSAlertPanel,objective-c,macos,nsalert,Objective C,Macos,Nsalert,我正在使用runModelForWindow显示模型窗口,我在模型窗口中有一个按钮,每当用户单击此按钮时,我都需要在不关闭模型窗口的情况下显示一个警报面板。是否可能?我已尝试显示NSAlertPanel,它位于模型窗口后面,所以用户看不到它。请给我一些建议,我如何才能做到这一点 在运行“我的警报”面板之前,使用以下两行后,会在“模型”窗口顶部显示警报 ProcessSerialNumber psn = {0, kCurrentProcess}; TransformProcessType(&

我正在使用runModelForWindow显示模型窗口,我在模型窗口中有一个按钮,每当用户单击此按钮时,我都需要在不关闭模型窗口的情况下显示一个警报面板。是否可能?我已尝试显示NSAlertPanel,它位于模型窗口后面,所以用户看不到它。请给我一些建议,我如何才能做到这一点

在运行“我的警报”面板之前,使用以下两行后,会在“模型”窗口顶部显示警报

ProcessSerialNumber psn = {0, kCurrentProcess};
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
NSAlert*警报=[NSAlert alertWithMessageText:@“警报文本” 默认按钮:@“确定” 备选按钮:@“取消” 其他按钮:无 informativeTextWithFormat:@“]


在运行“我的警报面板”之前使用以下两行代码后,警报面板将警报显示在“模型”窗口的顶部

ProcessSerialNumber psn = {0, kCurrentProcess};
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
NSAlert*警报=[NSAlert alertWithMessageText:@“警报文本” 默认按钮:@“确定” 备选按钮:@“取消” 其他按钮:无 informativeTextWithFormat:@“]