How to work with multiple windows in Cocoa? I have created a cocoa application. When I run that application it automatically shows a default window. I've added a button in the window. When I click the button I want to open another window named MySecondWindow which I created in IB..

I created Window controller (MySecondWindowController) for MySecondWindow and linked it to the nib in IB. When I click the button in my main window, I am calling an IBAction that creates an instance of MySecondWindowController and calling the NSApp beginSheet: method with [mySecondWindowObj window]. I am getting the Modal session requires modal window message in NSlog. When I try to print [mySecondWindowObj window] in NSLog, it prints null..

I don't know what to do. What are the necessary things should be done to make this work? I need help..

Thanks..

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top