0
我對Mac開發真的很陌生(雖然我有很多iOS體驗),我試圖在NSWindow中的NSViewControllers之間切換。這很簡單:按下按鈕時,顯示第二個視圖並隱藏第一個視圖。這裏是我的代碼:在NSWindow中切換視圖
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
firstView = [[FirstView alloc] initWithNibName:@"FirstView" bundle:nil];
[_window setContentView:menu.view];
}
- (IBAction)openSecondView:(id)sender {
secondView = [[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
[_window setContentView:game.view];
}
我確保該方法被調用,並且該secondView加載正確。這裏有什麼問題?
我不知道'animator',謝謝! – Cristian