title: How to create custom NSAlert Sheet Method with the Completion Handler paradigm
body: <p>I have used this simple general method for a While and it works fine for App Based dialogs, however I would like the same functionality in a sheet style dialog and I am having a hard time getting one together.</p>
  
  <p>According to the docs as I understand them, the only non deprecated approach from OS10.9 and beyond is to use the NSAlert class with the completion handler process. It seems to make it almost impossible to return a Bool from the general purpose method.</p>
  
  <p>My Code:</p>
  
  <pre><code>-(BOOL)confirm :(NSString*)questionTitle withMoreInfo:(NSString*)addInfo andTheActionButtonTitle:(NSString*)actionType{
      BOOL confirmFlag = NO;
  
      NSAlert *alert = [NSAlert alertWithMessageText: questionTitle
                                   defaultButton:actionType
                                 alternateButton:@"Cancel"
                                     otherButton:nil
                       informativeTextWithFormat:@"%@",addInfo];
      [alert setAlertStyle:1];
  
      NSInteger button = [alert runModal];
  
      if(button == NSAlertDefaultReturn){
          confirmFlag = YES;
  
       }else{
  
          confirmFlag = NO;
       }
  
       return confirmFlag;
  
   }
  
  
   The [alert runModal] returns the value I can return.
  </code></pre>
  
  <p>Using the newer paradigm, [alert beginSheetModalForWindow:[self window]sheetWindow completionHandler: some_handler] does not allow me to update or return the value at the end of the method. I know why, but is there a way I'm not thinking of to accomplish this.</p>
  
  <p>Please show me how to create a similar method to the one I've ben using for sheets.</p>
  
  <p>Thanks
  Mie</p>