Question

Ok, I have two windows, A and B. When I click a button on Window A, I want it to close and take the user to Window B. makeKeyAndOrderFront does a great job of activating Window B, but how do you get it to then close Window A?

Was it helpful?

Solution

Send window A a close or performClose: message (depending on whether you want to emulate the user closing the window, which is the latter, or simply close it immediately and unconditionally).

Note that closing the window may release it; see the releasedWhenClosed property, which has a checkbox in IB and may already be turned on there. You may want to order the window out (as compared to ordering in, such as by ordering front) instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top