NSWindowController windowDidLoad not called

前端 未结 4 1972
独厮守ぢ
独厮守ぢ 2020-12-14 11:50

I have a simple Cocoa app using a NSWindowController subclass. In the nib I have set:

  • File Owner\'s class to my NSWindowController subclass
  • The \'Wi
4条回答
  •  被撕碎了的回忆
    2020-12-14 12:37

    if you wrote

    TTEst *test3 = (TTEst *)[[NSWindowController alloc] initWithWindowNibName:@"TTEst"];
    

    try instead

    TTEst *test3 = [[TTEst alloc] initWithWindowNibName:@"TTEst"];
    

    it makes the difference ! Of course the first line was a mistake...

提交回复
热议问题