didEndSelector가 호출되지 않는 이유를 알 수 없습니다. 어떤 아이디어?내 NSAlert의 didEndSelector가 호출되지 않는 이유는 무엇입니까?
- (void) showMonitorAlertIfNeeded {
if (! self.monitorAlert && [self isHideMonitorAlert]) {
self.monitorAlert = [MMAlertController monitorAlert];
[[self.monitorAlert window] setTitle: [self applicationName]];
[self.monitorAlert beginSheetModalForWindow: [NSApp keyWindow]
modalDelegate: self
didEndSelector: @selector(monitorAlertDidEnd:returnCode:contextInfo:)
contextInfo: nil];
[[self.monitorAlert window] setLevel: NSScreenSaverWindowLevel];
}
}
- (void) monitorAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (id) contextInfo {
switch (code) {
case NSAlertFirstButtonReturn:{
}
NSLog(@"FIRST BUTTON PRESSED");
break;
case NSAlertSecondButtonReturn:{ // don't show again.
NSLog(@"SECOND BUTTON PRESSED");
[[NSApp delegate]setIsHideMonitorAlert:NO];
}
break;
default:
break;
}
}
스위치 외부에서 NSLog를 사용해 보셨나요? – paulmelnikow
흠, 그냥 실제로 해봤 어. 그것은 왜, 내 스위치 진술을 호출하지 않는 어떤 아이디어라고? – arooo