Advertisement
Guest User

iAd

a guest
Mar 19th, 2013
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @property (strong, nonatomic) ADBannerView *iADbanner;
  2.  
  3. - (void)viewDidLoad
  4. {
  5. [super viewDidLoad];
  6. self.iADbanner = [[ADBannerView alloc] initWithFrame:CGRectZero];
  7. self.iADbanner.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
  8. self.iADbanner.center = CGPointMake(160, 460-25);
  9. [self.iADbanner setHidden:YES];
  10. [self.view addSubview:self.iADbanner];
  11. [self.view bringSubviewToFront:self.iADbanner];
  12. }
  13.  
  14.  
  15. #pragma mark iAd
  16. - (void)bannerViewDidLoadAd:(ADBannerView *)banner{
  17. [self.iADbanner setHidden:NO];
  18. }
  19. - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
  20. NSLog(@"%@",error);
  21. [self.iADbanner setHidden:YES];
  22. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement