gpt4 book ai didi

objective-c - 重写 NSWindowController

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

有一个小问题,我正忙于创建 OSX 应用程序。在我的第一个 View (appdelegate)中,我得到了一个登录屏幕,但是在用户登录后我想要(翻转登录 Controller (main.xib)以删除登录屏幕并打开一个新的 NSWindowcontroller。

最好的方法是什么?我试过了;

    Second = [[SecondController alloc] initWithWindowNibName:@"SecondController"];

[[Second window] makeFirstResponder:nil];

但是现在第二个 Controller 出现,但第一个 Controller 保留。在 iOS 开发中,我正在做(想要同样的事情,但不是 OSX)

CategoriesViewController *tableController = [CategoriesViewController alloc];

tableController.managedObjectContext = [self managedObjectContext];

self.navigationController = [[UINavigationController alloc] initWithRootViewController:tableController];

最佳答案

卡明是正确的,但你可以这样做

[您的窗口关闭:nil];

关于objective-c - 重写 NSWindowController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13124055/

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