- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];
[textView setFont:[UIFont fontWithName:@"TrebuchetMS" size:12]];
adView=[[ADBannerView alloc] initWithFrame:CGRectMake(0.0f, 460.0f, 0.0f, 0.0f)];
adView.currentContentSizeIdentifier=ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:adView];
self.adView.delegate=self;
self.bannerIsVisible=NO;
UIDevice *theDevice=[UIDevice currentDevice];
NSString *iOS;
iOS=theDevice.systemVersion;
float iOS2 = [iOS floatValue];
if (iOS2>=4.0) {
self.bannerIsVisible = NO;
}
[super viewDidLoad];
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
if(!self.bannerIsVisible) {
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
banner.frame=CGRectOffset(banner.frame, 0, -50.0f);
[UIView commitAnimations];
self.bannerIsVisible=YES;
}
}
出了什么问题?
答案 0 :(得分:1)
请勿两次致电[super viewDidLoad];
。
答案 1 :(得分:0)
设置环境变量NSZombieEnabled = YES并再次运行代码。然后查看崩溃日志。您正在尝试访问已经解除分配的实例。