• 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: Ken Thomases <email@hidden>
  • Date: Mon, 24 Aug 2015 12:58:57 -0500

On Aug 24, 2015, at 12:53 PM, Alex Kac <email@hidden> wrote:
>
> I’ve also tried this…and the code in the dispatch_async never gets called. I’ve seen other code on github that does something similar so obviously it *should* work.
>
> - (IBAction)enterRegCode:(id)sender {
>
> 	registrationWindowController = [[RegistrationWindow alloc] initWithWindowNibName:@"RegistrationWindow"];
>
> 	__weak PIIntroWindowController* weakSelf = self;
>
> 	[self.window beginSheet:registrationWindowController.window completionHandler:^(NSModalResponse returnCode) {
> 		registrationWindowController = nil;
>
> 		if (returnCode == 1)
> 		{
> 			quitMeansCloseWindow = YES;
> 			dispatch_async(dispatch_get_main_queue(), ^{
> 				NSLog(@“Do I get called?”);
> 			});
> 		}
>
> 	}];
>
> }

Have you tried logging returnCode above the "if"?  The obvious reason that your log statement would not run is that returnCode is not 1.

Regards,
Ken


_______________________________________________

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>)
 >Re: 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: Re: Close Modal window after sheet ends
  • Index(es):
    • Date
    • Thread