-1

MobclixiOS应用程序中使用标准设置过程,并且从内部调用该requestAndDisplayAdFromViewController:方法viewWillAppear:

    - (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [fullScreenAdViewController requestAndDisplayAdFromViewController:self];

}

这是我收到的警告:

Warning: Attempt to present <MobclixFullScreenAdViewController: 0x14f2c0> on <EditGameViewController: 0x1838d0> whose view is not in the window hierarchy!

我希望这足以继续。谢谢你的帮助。

4

4 回答 4

3

您从 viewWillAppear 调用它 - 此时,视图不一定在层次结构中(它会出现,并不意味着它已经出现)。尝试从 viewDidAppear 调用它,当视图被确认在层次结构中时调用它。

于 2013-03-27T13:11:08.030 回答
0

您也可以尝试在 viewDidLoad 方法中显示视图。

于 2013-03-27T13:13:08.987 回答
0

您应该尝试将此代码移动到 viewDidAppear。

从关于 viewWillAppear 的 Apple 文档中:

This method is called before the receiver’s view is about to be added to a view hierarchy
于 2013-03-27T13:13:37.300 回答
0

尝试将您的代码移动 [fullScreenAdViewController requestAndDisplayAdFromViewController:self];viewDidAppear.

于 2013-03-27T13:12:45.150 回答