How to fix the warning: view is not in the window hierarchy

前端 未结 4 615
闹比i
闹比i 2021-01-29 07:19

I\'m using the standard setup procedure for Mobclix in an iOS app and I\'m calling the requestAndDisplayAdFromViewController: method from

4条回答
  •  借酒劲吻你
    2021-01-29 07:25

    You're calling it from viewWillAppear - at this point, the view is not necessarily in the hierarchy yet (it WILL appear, doesn't mean it has appeared yet). Try calling it from viewDidAppear, which is called when the view is confirmed to be in the hierarchy.

提交回复
热议问题