Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 45

trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
04/30/13 03:26 PM (12 years ago)

screens not unloading...

Hi I have some content using Custom URL screen, and i had some weird behaviour - i had a banner that would load with the custom url screen, but when nvigating to another screen (example - menu buttons), the banner would mysteriously re-appear. Very frustrating and whatever i tried, i could not rid of it. Then i noticed in the output panel, that the customurl screen was still running. 2013-04-30 23:23:07.129 UK RaceTrack Finder[17029:c07] BT_screen_customURL: shouldStartLoadWithRequest: URL: http://tsl-timing.com/LiveTiming.aspx?id=bmcrc 2013-04-30 23:23:07.130 UK RaceTrack Finder[17029:c07] BT_screen_customURL: shouldStartLoadWithRequest: SCHEME: http 2013-04-30 23:23:07.130 UK RaceTrack Finder[17029:c07] BT_screen_customURL: webViewDidStartLoad 2013-04-30 23:23:07.131 UK RaceTrack Finder[17029:c07] BT_screen_customURL: showProgress 2013-04-30 23:23:07.131 UK RaceTrack Finder[17029:c07] BT_viewUtilities: getProgressView 2013-04-30 23:23:07.315 UK RaceTrack Finder[17029:c07] BT_screen_customURL: webViewDidFinishLoad 2013-04-30 23:23:07.315 UK RaceTrack Finder[17029:c07] BT_screen_customURL: hideProgress 2013-04-30 23:23:16.599 UK RaceTrack Finder[17029:c07] WB_screen_menuImage: iAd bannerViewDidLoadAd 2013-04-30 23:23:16.599 UK RaceTrack Finder[17029:c07] WB_screen_menuImage: showHideAdView: looking closer, its also still processing iAd banner from menuImage screen (im currently sitting on menuButtons) is that normal?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
04/30/13 11:37 PM (12 years ago)
Hmm... This doesn't seem normal. If I understand this, the URL screen should show the ad but the menu should not. If this is correct, have you ensured that the menu screen has ads turned OFF? I ask because the ad-view should not even show if the screen has ad's turned off. It's possible that the iAd content is taking a bit to load, meaning it could be that it's not done loading until after you leave the previous URL screen. In this case, the "ad finished loading" method would fire (because the ad finished loading) but because you're not on the URL screen the ad view itself should be hidden. Weird. Make sure the enable ads is OFF in the menu and see what happens.
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
05/01/13 12:14 AM (12 years ago)
Hi David It was a revmob banner in custom url that was continuing in the menubuttons screen. The menubuttons screen had no adverts on it, and the ads were loading up into the customurl screen before i went back to custombuttons. I put a command into cutombuttons viewwillappear [[RevMobAds session] hideBanner]; that has cured the ads issue (also had to #import <RevMobAds/RevMobAds.h> into the menubuttons to allow for that) the iAds which were being reference by menuimage screen/s were not showing in any other screens, which is correct. Is it a bit weird though that those screens are not becoming inactive when leaving them?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/01/13 01:48 AM (12 years ago)
"not becoming inactive when leaving them" Yes, this makes sense, that they would somehow "die" or "go away" when the user navigates away from them. But...and here in lies some hidden complexities... Background processes are common in mobile so longer running tasks can continue without locking the UI. This sounds like one of those examples. RevMob (I don't have their code so I'm assuming some things here) says "Hey, go get an ad" on this screen" like... 1) Screen loads. RevMob tries to fetch an ad for it. This is a background process. 2) The ad arrives but you've already left the screen. 3) RevMob creates a banner and displays it in the navigation controllers current view. Not sure but this could be happening. The debug statements showing in the log are showing you the order in which iOS is firing individual methods. We worked super hard at putting these in the code so you could use the output console for clues when things didn't go well. Is there a way to "cancel RevMob ad download" when the user navigations away? Like in the viewWillDissappear method on a viewController? RevMob may have a "cancel" method or something?
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
05/01/13 01:53 PM (12 years ago)
hi David, sure, it makes sense that some things happen in the background, and i sorted rev mob out with a hidebanner command. Was just concerned that if many screens were doing this, it could cause a memory issue or something. Everything seems to work aok though
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.