I am getting this warning after 10 screenviews.
More than 10 instances of ADBannerView or ADInterstitialView currently exist. This is a misuse of the iAd API, and ad performance will suffer as a result. This message is printed only once.
I have implemented AdBannerView
through InterfaceBuilder. I am not explicitely creating an ADBannerView programmatically each time the view is loaded.
I am just referencing the AdBannerView
as an @IBOutlet:
@IBOutlet weak var iAdsBanner: ADBannerView!
and hiding/showing it by changing its position, as suggested by Apple documentation.
Why am I getting this kind of error?
Why are your making an outlet for bannerView. After iOS 7 things have been changed. If you want iAds then all you need to do is add the iAdsFramework
, import the framework in your UIViewController
and in your viewDidLoad()
write the following code
self.canDisplayBannerAds = true;
It will start displaying ads.
UPDATE
Forget the canDisplayBannerAds
thing as your requirement is different. Just create a single instance for banner View in your AppDelegate
and in your view controller get that instance , set frames and add it as subview and don't forget to remove it when your controller disappears.check this link you will get the idea. stackoverflow.com/questions/28514758/…
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With