Answer the question
In order to leave comments, you need to log in
Internet check and iAd?
Hello. I have been suffering for several days with iAd, now the last problem was the display of ads when the Internet disappears in the application. That is, if you abruptly switch to "Airplane Mode", thereby turning off the Internet, then the banner "You're Connected To iAd" remains, when you click it, it opens (it's standard where the animation is with a checkmark), when you return to the application, there is no longer a banner - according to this parts are ok.
But if you turn on the Internet, the banner does not appear. How to make a check every time you enter the application?
It's just that everything is complicated by the fact that I made a Tab Bar application with four Table View Controllers, and I will have to check on each of them ...
Here is the code
- (void)viewDidLoad {
[super viewDidLoad];
_UIiAD = [[self appdelegate] UIiAD];
_UIiAD.delegate = self;
}
-(void) viewWillAppear:(BOOL)animated{
_UIiAD = [[self appdelegate] UIiAD];
_UIiAD.delegate = self;
[_UIiAD setFrame:CGRectMake(0, self.view.frame.size.height - 99, 320, 50)];
[_UIiAD setAlpha:0];
[self.view addSubview:_UIiAD];
}
-(void) viewWillDisappear:(BOOL)animated{
_UIiAD.delegate = nil;
_UIiAD=nil;
[_UIiAD removeFromSuperview];
}
//Успешная загрузка
-(void)bannerViewDidLoadAd:(ADBannerView *)banner{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[_UIiAD setAlpha:1];
[UIView commitAnimations];
}
//Ошибка загрузки
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[_UIiAD setAlpha:0];
[UIView commitAnimations];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question