gpt4 book ai didi

objective-c - 当我的对象的工作表显示时,如何通知它?

转载 作者:行者123 更新时间:2023-12-03 17:58:38 26 4
gpt4 key购买 nike

我的 Cocoa 应用程序显示一个工作表,需要在即将显示时进行一些设置。我相信放置设置代码的正确位置是在显示工作表时调用的委托(delegate)方法中。哪个对象应该是委托(delegate)者?我应该实现哪种委托(delegate)方法?

最佳答案

您应该使用 NSWindowDelegate 方法 windowWillBeginSheet: 来进行设置。也许,委托(delegate)应该位于您的窗口或窗口 Controller 类中(如果您有其中之一),否则位于应用程序委托(delegate)中。

关于objective-c - 当我的对象的工作表显示时,如何通知它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9894523/

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