当我启动我的应用时,会弹出一个包含广告的页面,使用以下代码:
subviewArray = [[NSBundle mainBundle] loadNibNamed:@"StartView" owner:self options:nil];
startView = [subviewArray objectAtIndex:0];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[self view] cache:YES];
[UIView commitAnimations];
[self.view addSubview:startView];
[self startViewDidLoad];
并删除:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view.superview cache:YES];
[UIView commitAnimations];
[startView removeFromSuperview];
[adwhirlView1 removeFromSuperview];
[adwhirlView2 removeFromSuperview];
// REMOVE BANNERS
当我在模拟器ios 5.0中运行它时它工作正常,子视图弹出,并删除工作正常。然而,在ipod touch上的ios 4.2.1上,视图会移除然后再次弹出。它可能与我的代码有关,还是与页面上的广告有关,因为它们不能在ipod上工作?
干杯