1

I'm having troubles using a NSAlert panel when I am already inside a modal window. What happens is that when the alert panel is closed also the parent modal session is terminated.

The modal window is performed using NSModalSession in the usual way

modal_session = [NSApp beginModalSessionForWindow:modalwindow];

for (;;) {
    if ([NSApp runModalSession:modal_session] != NSModalResponseContinue)
            break;
    // do some work...
}
[NSApp endModalSession:modal_session];

while the alert panel is run using [myAlertPanel runModal]

Cocoa documentation does not deem this situation as improper, on the contrary it seems to state that this should be perfectly possible.

Any suggestion?

4

0 回答 0