@@ -71,6 +71,8 @@ @interface MMAlert : NSAlert {
7171}
7272- (void )setTextFieldString : (NSString *)textFieldString ;
7373- (NSTextField *)textField ;
74+ - (void )beginSheetModalForWindow : (NSWindow *)window
75+ modalDelegate : (id )delegate ;
7476@end
7577
7678
@@ -1533,9 +1535,7 @@ - (void)handleShowDialog:(NSDictionary *)attr
15331535 }
15341536
15351537 [alert beginSheetModalForWindow: [windowController window ]
1536- modalDelegate: self
1537- didEndSelector: @selector (alertDidEnd:code:context: )
1538- contextInfo: NULL ];
1538+ modalDelegate: self ];
15391539
15401540 [alert release ];
15411541}
@@ -1602,13 +1602,19 @@ - (void)setInformativeText:(NSString *)text
16021602
16031603- (void )beginSheetModalForWindow : (NSWindow *)window
16041604 modalDelegate : (id )delegate
1605- didEndSelector : (SEL )didEndSelector
1606- contextInfo : (void *)contextInfo
16071605{
1606+
1607+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1608+ [super beginSheetModalForWindow: window
1609+ completionHandler: ^(NSModalResponse code) {
1610+ [delegate alertDidEnd: self code: code context: NULL ];
1611+ }];
1612+ #else
16081613 [super beginSheetModalForWindow: window
16091614 modalDelegate: delegate
1610- didEndSelector: didEndSelector
1611- contextInfo: contextInfo];
1615+ didEndSelector: @selector (alertDidEnd:code:context: )
1616+ contextInfo: NULL ];
1617+ #endif
16121618
16131619 // HACK! Place the input text field at the bottom of the informative text
16141620 // (which has been made a bit larger by adding newline characters).
0 commit comments