4

I am working on an universal app and want to add an Ad Banner to it, the iAd is working fine in iPhone, But how to control that for iPad.

Because latest version of iPad supports iAd but in different size format and that gives error in my interface Builder when i targets for iPad 3.2.

Ramdhas
  • 1,765
  • 1
  • 18
  • 26
Ranjeet Sajwan
  • 1,925
  • 2
  • 28
  • 60
  • can you help in this http://stackoverflow.com/questions/5947552/how-to-display-test-iad-banner-in-the-simulator – ajay May 11 '11 at 16:07

1 Answers1

3

Well, I haven't done that yet in my iPad apps, but here's how I would do it.

  • First of all, I would mark the iAd framework as a weak/optional link. This would be the first step for compatibility with pre-iOS4. If you don't do that, the app may not even startup
  • Secondly, I wouldn't add it in the nib file (if using one). I would rather add it programmatically to be ale to check if the iAd framework is available on device.
  • Finally check if iAd is present. If it is, setup the ad, but if it isn't, just continue, or setup admob instead or something.

How to check that iAd is present? One of the simple ways is doing something like this

if(NSClassFromString(@"ADBannerView") != nil) {
    //iAd is present
}

Hope this helps

Alaa Nassef
  • 280
  • 2
  • 13
  • can you help in this http://stackoverflow.com/questions/5947552/how-to-display-test-iad-banner-in-the-simulator – ajay May 11 '11 at 16:07