gpt4 book ai didi

cocoa - NSApplication 委托(delegate)和首选项 Pane

转载 作者:行者123 更新时间:2023-12-03 17:29:28 25 4
gpt4 key购买 nike

看来我无法从“系统偏好设置” Pane 中控制 NSApp 委托(delegate),这是可以理解的。当程序激活时,是否有其他方法可以通知我的对象?

最佳答案

Cocoa 框架中的大多数委托(delegate)方法只是通知方法。这包括 application{Will,Did}{Become,Resign}Active:,它们是 NSApplication{Will,Did}{Become,Resign}ActiveNotification 的通知方法。通知与委托(delegate)方法位于同一位置:the NSApplication documentation .

因此,只需在本地 NSNotificationCenter 上注册这些通知即可。

关于cocoa - NSApplication 委托(delegate)和首选项 Pane ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/326754/

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