gpt4 book ai didi

cocoa - 是否可以使用 Nib 中的对象作为动态创建多个新对象的模板?

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

我想在IB中设计一个带有WebView的NSwindow来显示弹出链接。我需要能够实例化任意数量的这些。这可能吗?

最佳答案

当然。通常,您的窗口 Controller 会子类 NSWindowController .

MyWindowController* controller = [[MyWindowController alloc] initWithWindowNibName:@"MyWindowView"];

[controller showWindow];

在您的 Nib 中,将 Owner 设置为 MyWindowController,然后根据需要连接您的 socket 。

关于cocoa - 是否可以使用 Nib 中的对象作为动态创建多个新对象的模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1515414/

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