• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Close Modal window after sheet ends
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Close Modal window after sheet ends (From: Alex Kac <email@hidden>)

  • Prev by Date: Re: Close Modal window after sheet ends
  • Next by Date: Re: Close Modal window after sheet ends
  • Previous by thread: Re: Close Modal window after sheet ends
  • Next by thread: Presenting VCs as Sheets — Completion Handler?
  • Index(es):
    • Date
    • Thread