As I said my iAd is working sometimes but sometimes its not working.It usually works during the first simulator run but if I begin to open different pages it begin not to work so my codes forces banner to close itself(apple rules).Its really strange cause I dont know why its doing this sometimes it works without any problem no matter how many view controllers I pass it keeps working but if it begin to not work then it keeps not working for many viewcontrollers(which has different h and m files) then suddenly it begins to work and after couple of successful ad showing it begins not work again.I can say that its working succses is below %40 so I have to solve it.

Is this something related to apple iad servers ?

I am testing my app on simulator 5.1 and I can only receive iad testing ads for my banner so can they be the reason of this strange problem ?

Is it a normal thing for iAd ?

Is my code is the one to blame is it missing something ?

Is it about relasing iAd or can I force it to try to open iad again ?

If you know your way around about this iad please help me !

h file

```
#import <UIKit/UIKit.h>
#import <iAd/iAd.h>

@interface a1viewcontroller : UIViewController < UIImagePickerControllerDelegate, UINavigationControllerDelegate > {

  ADBannerView *banner;    

}

@property (nonatomic, assign)BOOL bannerIsVisible;
@property (nonatomic, retain)IBOutlet ADBannerView *banner;

@end

```

m file

```
@synthesize banner, bannerIsVisible;

-(void)bannerViewDidLoad: (ADBannerView *)abanner {

    if (!self.bannerIsVisible) {
        [UIView beginAnimations:@"animatedAdBannerOn" context:NULL];
        banner.frame = CGRectOffset(banner.frame, 0.0, 50.0);
        [UIView commitAnimations];
        self.bannerIsVisible = YES;
    }

}

-(void)bannerView:(ADBannerView *)aBanner {

    if (!self.bannerIsVisible) {
        [UIView beginAnimations:@"animatedAdBannerOff" context:NULL];
        banner.frame = CGRectOffset(banner.frame, 0.0, -320.0);
        [UIView commitAnimations];
        self.bannerIsVisible = NO;
    }

}

```

The code is same for other view controllers.