viewWillAppear or viewDidAppear on NSWindowController

后端 未结 2 1405
轻奢々
轻奢々 2021-02-13 04:02

I\'m developing an app on MacOS X with Xcode5.1

and there\'s an action I want to trigger everytime the user opens or shows a NSWindowController all I found was

2条回答
  •  北恋
    北恋 (楼主)
    2021-02-13 04:19

    If you really need to know the windows occlusion state go with @Cemen's answer, otherwise I'd recommend you just use the

    viewWillAppear
    viewDidAppear
    

    etc. of your windows contentViewController. Just subclass that and override it there.

提交回复
热议问题