I'm trying to open a sheet attached to a window, after choosing a file from an open panel which is attached to the same window. I tried opening the sheet from the didEndSelector: of the open panel, but the code gets executed immediately when the Open button is pushed, and not when the open panel is finished closing. This is a problem because before the open panel finishes closing, the new sheet opens then for some reason the main window closes, and I am just left with a sheet that is attached to nothing (it is just a square box floating and can't be moved). Any suggestions? Thanks in advance.