如何在Cocoa中为同一个窗口创建多个视图?
我的应用程序有一个应用程序委托和一个窗口。我有不同的类运行线程等。当我发送 NSWindow *window 指针到该类或函数,并尝试更改 VIew 时,[window setcontentView//something]。它不显示任何内容,我做错了什么?拥有一个窗口和不同的类,并从不同的类更改该窗口的内容的最简单方法是什么。谢谢。
I have application that has one Application delegate, and one Window. I have different classes that running threads, etc. When I'm sending NSWindow *window pointer to that classes or function, and trying to change VIew , [window setcontentView//something]. It doesn't display anything ,what I am doing wrong ? What is the easiest way to have one window, and different classes, and change that Content for that window, from different classes. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您应该实现 UIApplicationDelegate 方法 didFinishLaunchingWithOptions ,如下所示:
稍后您可以创建不同的 UIViewController 实例并将它们推送到 UINavigationController 对象。
At first you should implement your UIApplicationDelegate method didFinishLaunchingWithOptions something like this:
Later you can create different UIViewController instances and push them to UINavigationController object.