didMoveToWindow: How will this method be called?

2019-09-04 19:54发布

I spent time searching this without much success (including documentation), still left puzzled the didMoveToWindow: method.

Using didMoveToWindow: in a stock view project template:

-(void)didMoveToWindow{

    [super didMoveToWindow];

    // do something

}

gives the following warning:

Warning: 'UIViewController' may not respond to 'didMoveToWindow'

It is not called on start up of view which is a surprise.
How will this method be called?

标签: ios xcode uiview
2条回答
Lonely孤独者°
3楼-- · 2019-09-04 20:11

didMoveToWindow is a method of UIView, not UIViewController.

查看更多
登录 后发表回答