Re: Close Modal window after sheet ends
Re: Close Modal window after sheet ends
- Subject: Re: Close Modal window after sheet ends
- From: Quincey Morris <email@hidden>
- Date: Mon, 24 Aug 2015 17:56:33 +0000
On Aug 24, 2015, at 10:41 , Alex Kac <email@hidden> wrote:
>
> registrationWindowController = [[RegistrationWindow alloc] initWithWindowNibName:@"RegistrationWindow"];
>
> [self.window beginSheet:registrationWindowController.window completionHandler:^(NSModalResponse returnCode) {
> registrationWindowController = nil;
>
> if (returnCode == 1)
> {
> [[NSApplication sharedApplication] stopModal];
> [self.window close];
> //[self.window orderOut:nil]
> }
> }];
At the very least, you should order out the sheet (inside the if block) before doing anything to the window underneath.
Also, though probably unrelated to the current behavior, you probably shouldn’t simply nil out the sheet window controller reference like that. Doing so can (and I think always will) leave a dangling invalid pointers from the window — the “windowContoller” and “delegate” properties, for example. You should first set the relevant window properties to ni
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden