如果我在XCode 5.0.2中创建一个新的单一视图项目,添加iAd Framework,在ViewController.h中实现ADInterstitialAdDelegate
#import <UIKit/UIKit.h>
#import <iAd/iAd.h>
@interface ViewController : UIViewController <ADInterstitialAdDelegate>
@end
和ViewController.m中的委托方法
-(void)viewDidLoad
{
[super viewDidLoad];
[ self performSelector:@selector(onDelay) withObject:nil afterDelay:2 ];
}
-(void)onDelay
{
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[ self requestInterstitialAdPresentation ];
}
-(void)interstitialAd:(ADInterstitialAd *)interstitialAd didFailWithError:(NSError *)error
{
NSLog(@"interstitialAd didFailWithError");
}
-(void)interstitialAdDidLoad:(ADInterstitialAd *)interstitialAd
{
NSLog(@"interstitialAdDidLoad");
}
没有调用ADInterstitialAdDelegate方法。我在使用iOS 6及更低版本中的旧实现时遇到了一些问题
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
[ interstitial presentFromViewController:self ];
仅
-(void)interstitialAdDidLoad:(ADInterstitialAd *)interstitialAd
然后调用,但没有
- (void)interstitialAdDidUnload:(ADInterstitialAd *)interstitialAd
关闭广告后有没有人记得遇到同样的问题或知道这里发生了什么?