Irwan
Irwan

Reputation: 793

How to auto close modal window in Cocoa?

I tried this but my program crashed.

- (void)windowWillClose:(NSNotification *)notification
{
    [modalWindow orderOut:self];
    [NSApp stopModal];
}

Upvotes: 1

Views: 1383

Answers (1)

Ken Aspeslagh
Ken Aspeslagh

Reputation: 11594

Most likely, modalWindow is not pointing to a valid object. That's the only obvious thing that would crash in those two lines. You should be able to use the debugger to find out more about why it's crashing before asking for help.

Upvotes: 1

Related Questions