0
因此,您可以在這裏看到,XCode正在抱怨,但我不知道爲什麼,所以......我的代碼出了什麼問題?我已經導入了iAd框架。 XCode抱怨 - (void)viewDidLoad,它說:「缺少@end」XCode抱怨viewDidLoad和「Missing @end」(iAd)
那麼,我的代碼有什麼問題?
的.H
@interface ViewController : UIViewController{
ADBannerView *banner;
UILabel *label;
}
@property (nonatomic, assign)BOOL bannerIsVisible;
@property (nonatomic, retain)IBOutlet ADBannerView *banner;
@end
的.M
@implementation ViewController
@synthesize banner, bannerIsVisible;
-(void)bannerViewDidLoadAd:(ADBannerView *)abannar {
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 didFailToReceiveAdWithError:(NSError *)error {
if(!self.bannerIsVisible) {
[UIView beginAnimations:@"animatedAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0.0, -320.0);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
奧克謝謝,我已經導入viewcontroller.h文件,但我沒有複製它。但是,感謝您的幫助! – Bart