Merge pull request #154 from macvim-dev/fix/beginSheetModalForWindow_warning

Fix beginSheetModalForWindow warning in a proper way
This commit is contained in:
Kazuki Sakamoto
2015-11-21 18:20:12 -08:00
+13 -7
View File
@@ -71,6 +71,8 @@ static BOOL isUnsafeMessage(int msgid);
}
- (void)setTextFieldString:(NSString *)textFieldString;
- (NSTextField *)textField;
- (void)beginSheetModalForWindow:(NSWindow *)window
modalDelegate:(id)delegate;
@end
@@ -1533,9 +1535,7 @@ static BOOL isUnsafeMessage(int msgid);
}
[alert beginSheetModalForWindow:[windowController window]
modalDelegate:self
didEndSelector:@selector(alertDidEnd:code:context:)
contextInfo:NULL];
modalDelegate:self];
[alert release];
}
@@ -1602,13 +1602,19 @@ static BOOL isUnsafeMessage(int msgid);
- (void)beginSheetModalForWindow:(NSWindow *)window
modalDelegate:(id)delegate
didEndSelector:(SEL)didEndSelector
contextInfo:(void *)contextInfo
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
[super beginSheetModalForWindow:window
completionHandler:^(NSModalResponse code) {
[delegate alertDidEnd:self code:code context:NULL];
}];
#else
[super beginSheetModalForWindow:window
modalDelegate:delegate
didEndSelector:didEndSelector
contextInfo:contextInfo];
didEndSelector:@selector(alertDidEnd:code:context:)
contextInfo:NULL];
#endif
// HACK! Place the input text field at the bottom of the informative text
// (which has been made a bit larger by adding newline characters).