Q:

No delegate, didFailToReceiveAdWithError

i have this code:
class ViewControllergame: UIViewController, ADBannerViewDelegate {

 var bannerView:ADBannerView!

 override func viewDidLoad() {
    super.viewDidLoad()
    self.canDisplayBannerAds = true
    bannerView?.delegate = self

    bannerView?.hidden = true
 }

     func bannerViewDidLoadAd(banner: ADBannerView!) {

    bannerView?.hidden = false
}

func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
    return willLeave
}

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
    bannerView?.hidden = true

}

}

But it goes not in the didFailToReceiveAdWithError, when my app goes in standby i get this error:
ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=1 "Service session terminated.

How can i fix this?

A:

It seems you've implemented the methods but they're never called because your banner delegate is not set. If you're using storyboards just 

Control-Drag

from your ADBannerView to the same ViewController where the banner is and then select "delegate" Outlet.

