제목과 마찬가지로 [myWindowController showWindow:nil]
이 작동하지 않습니다.NSWindowController showWindow : 아무것도하지 않습니다.
- 내 창 컨트롤러 :
KRAuthenticationWindowController
- 은 인터페이스 빌더 파일 :
AuthenticationWindow.xib
파일의 소유자가 창으로KRAuthenticationWindowController
window
콘센트에 연결되어있다- 윈도우의를 여기에 당신이 알아야 할 수있는 몇 가지 사실은
delegate
이 파일 소유자에게 연결되어 있음 - 창문의
Visible at launch
이 선택 취소되었습니다. - 윈도우의
Release when closed
는
내 코드는 아래에 제시도 선택하지 않은 :
// KRApplicationDelegate.m
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
NSLog(@"%s",__PRETTY_FUNCTION__);
KRAuthenticationWindowController *authWindowController = [[KRAuthenticationWindowController alloc] init];
[authWindowController showWindow:nil];
[[authWindowController window] makeKeyAndOrderFront:nil];
}
// KRAuthenticationWindowController.m
- (id)init {
self = [super initWithWindowNibName:@"AuthenticationWindow"];
if(!self) return nil;
NSLog(@"%s",__PRETTY_FUNCTION__);
return self;
}
- (void)loadWindow {
[super loadWindow];
[self.window setBackgroundColor:[NSColor colorWithDeviceWhite:0.73 alpha:1]];
NSLog(@"%s",__PRETTY_FUNCTION__);
}
- (void)windowDidLoad {
[super windowDidLoad];
NSLog(@"%s",__PRETTY_FUNCTION__);
}
- (void)showWindow:(id)sender {
[super showWindow:sender];
NSLog(@"%@",self.window);
NSLog(@"%s",__PRETTY_FUNCTION__);
}
내 콘솔 출력 :
2013-02-24 16:21:45.420 Application[3105:303] -[KRApplicationDelegate applicationDidFinishLaunching:]
2013-02-24 16:21:45.421 Application[3105:303] -[KRAuthenticationWindowController init]
2013-02-24 16:21:45.428 Application[3105:303] -[KRAuthenticationWindowController loadWindow]
2013-02-24 16:21:45.428 Application[3105:303] -[KRAuthenticationWindowController windowDidLoad]
2013-02-24 16:21:45.556 Application[3105:303] <NSWindow: 0x10016e860>
2013-02-24 16:21:45.556 Application[3105:303] -[KRAuthenticationWindowController showWindow:]
난 그냥 중요한 뭔가를 놓친 것 같아. 어떤 도움을 주시면 감사하겠습니다.
이 질문에 설명 된 문제가있을 수 있습니다. http://stackoverflow.com/questions/3539721/nswindowcontroller-loadwindow-loads-window-from-nib-but-showwindow-does-nothin – sergeyne
아니요. – akashivskyy