1

I've integrated iAd in my application. It works when I have an internet connection, but if I have no internet connection the ADBannerView repeats the same error message infinitely.

func addiAd()
{
    iAdBanner.frame = CGRectMake(0, 400 320 50
    iAdBanner.hidden = true
    iAdBanner.delegate = self
    self.view.addSubview(iAdBanner)
}

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!)
{
    println(error)
}

2015-06-21 04:43:04.857 Music Player[6219:121409] ADBannerView error: Unknown error
2015-06-21 04:43:04.866 Music Player[6219:121409] ADBannerView error: Unknown error
2015-06-21 04:43:04.876 Music Player[6219:121409] ADBannerView error: Unknown error
2015-06-21 04:43:04.885 Music Player[6219:121409] ADBannerView error: Unknown error
2015-06-21 04:43:04.895 Music Player[6219:121409] ADBannerView error: Unknown error
2015-06-21 04:43:04.906 Music Player[6219:121409] ADBannerView error: Unknown error
2015-06-21 04:43:04.918 Music Player[6219:121409] ADBannerView error: Unknown error
Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
sem sur
  • 21
  • 3
  • Are you using Swift 2? Does this occur on both the simulator and device? You're missing your closing parentheses when setting your `frame` and you need to include commas between your `frame`'s origins and widths. How are you creating your `ADBannerView`? Where is your `bannerViewDidLoadAd` delegate method? Can you provide the steps to reproduce the problem? I'm unable to recreate the issue you're experiencing. – Daniel Storm Jun 22 '15 at 10:43
  • Where are you calling the func addiAD()? and did you copy and paste it straight from Xcode? because on the 3rd line you are missing the closing bracket on your CGRectMake – Dom Bryan Jun 22 '15 at 10:49

0 Answers0