I do not manage iAd to work in the storyboard, within a UITableViewController.
What it's basically what I have done so far: In the storyboard, I have pulled an iAd banner view at the bottom of the scene of my UITT view controller. (I was not able to set the banner in the scene because the storyboard prevents it. I could only drag the IAD object near the first responder and the icons of the UITBL visual controller.)
in the header of the UITAbleViewController , I is:
#import & lt; UIKit / UIKit.h & gt; #import "ListViewController.h" #import & lt; IAd / iAd.h & gt; @Intease list view controller: UITableViewController & lt; ADBannerViewDelegate & gt; {Bool bannerIsVisible; } @ Property (strong, non-meticulous) IBolet ADBannerView * iAd; @end In the implementation of UITableViewController, I have:
- (zero) viewDidoad {[Super Viewedload]; IAd.delegate = self; // iAd.frame = CGRectMake (0.0,200.0, iAd.frame.size.width, iAd.frame.size.height); // does not work // self.tableView.tableFooterView = iAd; // Display the banner in the center of the screen (depending on number of items of the table) // Do not know how to see the default banner at the bottom of the screen (behind the tab bar) is full? } - (Zero) BannerView: (ADBannerview *) was bannedFileTorrowingAdvideoArror: (NSERR * *) Error {NSLog (@ "FailoverAviveWith Error"); If (bannerIsVisible) {[UIView startAnimations: @ "animateAdBannerOff" reference: NULL]; Banner.frame = secretemake (0.0350.0, banner.frame.image.width, banner.frame.size.height); [UIView commitAnimations]; Banner ISVZ = No; }} - (Zero) Banner Weididload AD: (ADBannerview *) Banner {NSLog (@ "BannerVidifiedAuded"); If (! BannerIsVisible) {[UIView Start Permissions: @ "Animate AdBinerOn" Reference: NULL]; Banner.frame = cgartextmac (0.0317.0, banner.frame.im.width, banner.frame.size.height); [UIView commitAnimations]; BannerIsvable = Yes; }} The idea is that the banner is displayed at the bottom of the screen and is shown above the tab bar, the banner load is successful.
I have a problem: With this configuration, I can see that sometimes the "didFailToReceiveAdWithError" method is called and sometimes "bannerViewDidLoadAd" is one, but in every case the banner is not shown. goes.
Your problem is common, not due to the storyboard, but due to this fact That you are using UITableViewController UITableViewControllers gives you a lot for free, but they need some things. One of those things is that they want their idea to be a UITableView . You have some options here.
1) Add your iAd as tableFooterView . This requires some extra work for it, when it scrolls while scrolling and runs on the screen. 2) Change your UITableViewController sub code to UIViewController subclass. It is interesting that the OP above the above question is ending. While animating IAd, you can enlarge the frame of the table view (now a subview) and then it will work as expected, most of them should be applicable to you.
Comments
Post a Comment