Question

I have an iOS application, with iAd using ADBannerView. It works perfectly in iOS 5, showing the ad full screen when the user taps on the banner. But when I run the exact same code in iOS 6, the navigation bar and tab bar shows on top of the ad:

enter image description here

Note that the "X" button on the Ad behind the nav bar works as it should to close the Ad, and the navigation bar and tab bar buttons work as well.

My app has a UITabBarController as the root controller, with 4 UINavigationControllers under it. And I did call this in didFinishLaunchingWithOptions:

[self.window setRootViewController:tabBarController];

What could be wrong? I'm guessing the view hierarchy is somehow not setup correctly.

Thanks in advance for your help!

Was it helpful?

Solution

I think I found the issue. This is most likely because my UIViewController hierarchy was not properly setup, in that I didn't have a addChildViewController: call where it's needed. The When to use addChildViewController vs pushViewController thread was very helpful.

An alternative that I'd recommend now is to simply use the code in the TabbedBanner project in the Apple iAdSuite sample.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top