gpt4 book ai didi

objective-c - 从另一个 NSAlert 的 didEndSelector 调用一个 NSAlert

转载 作者:行者123 更新时间:2023-12-03 16:24:32 25 4
gpt4 key购买 nike

我需要根据另一个 NSAlert 的响应来调出一个 NSAlert。但是,当我尝试从第一个的 didEndSelector 调用它时,会发生各种令人讨厌的事情(例如我的文档窗口消失以及有关打印到控制台的排序问题的警告)。

有什么想法吗?

最佳答案

您想要做的是“链接”警报。

为此,您需要在警报窗口上调用 orderOut:

这是文档:

If you want to dismiss the sheet from within the alertDidEndSelector method before the modal delegate carries out an action in response to the return value, send orderOut: (NSWindow) to the window object obtained by sending window to the alert argument. This allows you to chain sheets, for example, by dismissing one sheet before showing the next from within the alertDidEndSelector method. Note that you should be careful not to call orderOut: on the sheet from elsewhere in your program before the alertDidEndSelector method is invoked.

关于objective-c - 从另一个 NSAlert 的 didEndSelector 调用一个 NSAlert,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1547112/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com