0

I've implemented a singleton to display adWhirl ads. However, when I change scenes in my storyboard app, the viewController for the ad is not updated until a new ad is requested. I have viewControllerForPresentingModalView implemented in the singleton and I set it with displayVC on every viewdDidLoad. But since the VC is not changed until a new ad is requested, any previous ads (specifically admob) cannot display fullscreen because their VC is set to the previous scene. Any help is greatly appreciated!

adWhirlSingleton *adWhirlSingle = [adWhirlSingleton sharedAdSingleton];
adWhirlSingle.displayVC = self;
[adWhirlSingle adjustAdSize:0 :self.view.frame.size.height -50];
[self.view addSubview:adWhirlSingle.awView];
[self.view bringSubviewToFront:adWhirlSingle.awView];
4

1 回答 1

0

您的 ViewControllers 是否是某些包含 View Controller 的一部分(例如,它们是在 Navigation Controller 还是 Tabbed Controller 中?)。如果是,我建议将 displayVC 设置为包含视图控制器,这样您就不必更改它。

如果没有,也许这里概述的内容会有所帮助。基本上创建一个代理类型的类,然后将正确的消息转发到当前选择的 ViewController?

于 2012-07-16T19:12:52.713 回答