【发布时间】:2011-12-15 20:46:18
【问题描述】:
怎么样,伙计们? 所以今天这是一个非常荒谬的问题,但我无法让它按照我想要的方式工作。 我正在实施 AdMob,但我想了解更多信息。
他们在GoogleCodes/AdMob 上给出了说明 但我不能让它给我我想要的日志。
这是在.h
#import <UIKit/UIKit.h>
#import "GADBannerView.h"
#import "GADBannerViewDelegate.h"
@interface AppForAllTestsViewController : UIViewController<GADBannerViewDelegate>
这是在.m上
-(void)adViewDidReceiveAd:(GADBannerView *)bannerView{
NSLog(@"RECEIVED");
[UIView beginAnimations:@"BannerSlide" context:nil];
bannerView.frame = CGRectMake(0.0, self.view.frame.size.height - bannerView.frame.size.height,
bannerView.frame.size.width,
bannerView.frame.size.height);
[UIView commitAnimations];
}
-(void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error{
NSLog(@"FAILURE RECEIVING AD: %@", [error localizedDescription]);
}
-(void)adMobProcess{
adMobBanner = [[GADBannerView alloc]initWithFrame:CGRectMake(0.0,
self.view.frame.size.height-GAD_SIZE_320x50.height,
GAD_SIZE_320x50.width,
GAD_SIZE_320x50.height)];
adMobBanner.adUnitID = my_id;
adMobBanner.rootViewController = self;
[self.view addSubview:adMobBanner];
[adMobBanner loadRequest:[GADRequest request]];
}
-(void)awakeFromNib{
NSLog(@"GOOD MORNING");
[adMobBanner setDelegate:self];
}
- (void)viewDidLoad{
[self adMobProcess];
[super viewDidLoad];
}
您可以看到我将代理设置为“self”,但没有任何反应,没有任何更改,请任何人帮助我吗? (:
【问题讨论】:
-
你能更新你的代码吗?不太确定!