Note that there are some explanatory texts on larger screens.

plurals
  1. POAdmob Integration on iPhone - Memory Leak Problem
    text
    copied!<p>I wonder if anyone can help with the following. I have integrated both iAds and AdMob into my app. However a user reported that the app crashes on the iPod Touch. Using Instruments in xCode I have managed to identify that something called "GOOGLE_SHUFFLE_RVS_User_waylonis_Code_afma1_googlmac_iPhone_GoogleAds_Signals_Protected_build_GoogleAdsSignals_build_Release_iphoneos_Google" is causing a memory leak of about 500 bytes everytime it is called.My ad refresh rate is set at 20 seconds so this happens every 20 seconds.</p> <p>My code is as follows.</p> <pre><code>- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error { if (self.bannerIsVisible) { [UIView beginAnimations:@"animateAdBannerOff" context:NULL]; // banner is visible and we move it out of the screen, due to connection issue banner.frame = CGRectOffset(banner.frame, 0, -90); [UIView commitAnimations]; self.bannerIsVisible = NO; } [self loadAdMobAd]; } -(void)loadAdMobAd { if (!bannerView_) { CGRect adSize = CGRectMake (0,40,0,0); adSize.size = GAD_SIZE_320x50; bannerView_ = [[GADBannerView alloc] initWithFrame:adSize]; bannerView_.rootViewController = self; bannerView_.adUnitID = MY_BANNER_UNIT_ID; bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; // Initiate a generic request to load it with an ad. [bannerView_ loadRequest:[GADRequest request]]; } } </code></pre> <p>The idea is that if an iAd is not available an AdMob ad is loaded instead.</p> <p>Is there anything wrong with my code that could be causing the leak ?</p> <p>Many thanks,</p> <p>Martin</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload