0

Ok, i've this multi view IPhone application in which i've integrated adWhirl ads. That's the good news. The bad news is that i've literally implemented the adWhirl ads in each view controller, which means every time a view is pushed a new adWhirl object is created which takes time to load the AdMob/iAds advertisements. Now, I can't help thinking about this being the "wrong" way to go about the problem. So the question is, do I make a singleton ad object maybe in the appDelegate's didFinishLaunching method and use that ad object in all the view controllers or what I've done is pretty much how it should be done?

Tobias
  • 579
  • 1
  • 5
  • 15

2 Answers2

1

Put the ad in the appDelegate and reference or sub class it from all of the view controllers. I just finished a Tab Controller app that had a similar requirement. The performance gain was a nice bonus as well.

Walter
  • 5,867
  • 2
  • 30
  • 43
0

You could probably just add it to the window in the appDelegate.

[self.window addSubview:same_as_before.view];
[self.window addSubview:ad.view];
[self.window makeKeyAndVisible];

This way it will always be in the same spot on top of all other views and you won't have to deal with it again.

Casey
  • 2,393
  • 1
  • 20
  • 22
  • woah that sounds like a sweet idea!!! i'll try this out and get back here. Thanks a bunch for the suggestion! – Tobias Apr 09 '11 at 09:44