iAd iOS 7委托方法未被调用

时间:2013-11-23 15:09:24

标签: delegates iad interstitial

如果我在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
关闭广告后

有没有人记得遇到同样的问题或知道这里发生了什么?

0 个答案:

没有答案