我对mac编程很陌生。3天前才开始。
我正在制作一个示例应用程序,其中我在主窗口中有一个按钮
我正在使用此代码打开一个新的 wndowcontroller
ThirdViewController *tvc = [[ThirdViewController alloc] initWithWindowNibName:@"SecondViewController"];
[tvc showWindow:self];
这工作正常,但是当我再次按下按钮时,它会再次打开相同的窗口,所以每次点击后我都会在屏幕上显示 +1 窗口。
我想要的是如果我的新窗口已经在我的屏幕上,那么按钮不能添加相同的窗口。
提前致谢:)