Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iAd banner gone after dismissModalViewControllerAnimated

In my app delegate, I instantiate an iAd banner and assign it to a delegate property, then I load the main View Controller.

In the main View Controller, I add the iAd banner as a subview, and also instantiate a "Main Menu" view controller and add its view as a subview. Great, now I have a main menu for my app (using UINavigationController so other views are pushed/popped off the navigation stack, leaving the ad on top).

However, when I display a modal dialog (like send e-mail), and dismiss it, the iAd banner is gone, and the Main Menu view now takes up the whole screen. Is there something I need to do to "refresh" the iAd view on the top?

like image 991
Jay Imerman Avatar asked Apr 14 '13 19:04

Jay Imerman


1 Answers

It sounds like you have 2 UIViewControllers and you are trying to manually add the subview of one to the other without using any of the container API's - i am not surprised this doesn't work properly.

See "Creating Custom Container View Controllers" in the View Controller Programming Guide for iOS, or more easily, create a UIViewController subclass which always shows an Ad on top.

like image 181
Daniel Broad Avatar answered Oct 29 '22 12:10

Daniel Broad