Is it more appropriate to have one shared instance of and iAd for my app or can I create a new instance on each page of a navigation app? It seems Apple's sample code has only one ad that is used one each page. From my perspective more ads means more money. Is there an issue doing it in this manner or am I looking at this incorrectly?
-
Do you mean instances of ADBannerView? – ThomasW Jun 21 '11 at 02:25
4 Answers
Apple encourages you to use one instance of iAd Banner per app as a best practice. You can read the following technical note for how and why: http://developer.apple.com/library/ios/#technotes/tn2286/_index.html

- 447
- 5
- 11
Creating a new instance for every page would be standard. It is non-standard and to try to use the same instance across different pages. (To do that you'd need to remove the ADBannerView from its superview and then add it as a subview of the next view.)
My guess is that the amount of money you'd receive would be approximately the same either way. If you could get more money one way or the other it would be a bug that Apple would fix.

- 16,981
- 4
- 79
- 106
-
1I ended up creating a new instance on each page. Apple's sample code made no sense to use in a navigation controller since the ad would disappear from the old view then animate on with the next view. It made it look clunky. It might look O.K. with a tab bar controller since they do not animate. – Joe Fratianni Jul 22 '11 at 18:00
I think honestly you can do it either way. I have an app that is a paged scroll view that has an ADBannerView just off screen (below). When an add gets loaded the scroll view shortens by the height of the ADBannerView and the AdBannerView gets moved up. Its the same object for each page of the UIScrollView.
Some might argue though that my app is really only 1 view, since each 'page' is part of the same ScrollView.

- 311
- 1
- 12
According to the Apple sample code, you should use one instance. If you download the iAdSuite samples, you'll see this in the ReadMe.txt file:
Note: If your application has multiple tabs or views displaying an iAd banner, be sure to share a single instance of ADBannerView across each view. Then, before your users navigate to a new view, set the shared instance's delegate property to nil, remove it from the old view hierarchy, then add the same instance to the opening view and set its delegate to the appropriate view controller.

- 131
- 2
- 10