Interstitial Ads(iAd 和 Spritekit)出错
Getting an error with Interstitial Ads (iAd and Spritekit)
我在这部分代码中不断收到错误消息:
// Interstitial iAd
-(void)showFullScreenAd {
// Check if already requesting ad
if (requestingAd == NO) {
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[self requestInterstitialAdPresentation];
NSLog(@"interstitialAdREQUEST");
requestingAd = YES;
}
}
-(void)interstitialAd:(ADInterstitialAd *)interstitialAd didFailWithError:(NSError *)error {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAd didFailWithERROR");
NSLog(@"%@", error);
}
-(void)interstitialAdDidLoad:(ADInterstitialAd *)interstitialAd {
NSLog(@"interstitialAdDidLOAD");
if (interstitialAd != nil && interstitial != nil && requestingAd == YES) {
//[interstitial presentFromViewController:self];
//[interstitial presentInView:self.view] // I get an error on this line
NSLog(@"interstitialAdDidPRESENT");
if (interstitial.loaded) {
[self requestInterstitialAdPresentation]; //I also get an error on this line too
}
}
}
-(void)interstitialAdDidUnload:(ADInterstitialAd *)interstitialAd {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidUNLOAD");
}
-(void)interstitialAdActionDidFinish:(ADInterstitialAd *)interstitialAd {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidFINISH");
}
这与特定行有关:
[self requestInterstitialAdPresentation];
这是我遇到的错误,我不知道需要将此行更改为什么才能停止错误:
-[UIView setShowsFPS:]: unrecognized selector sent to instance 0x146e241a0
我过去在使用相同类型的代码时遇到过这个错误,它通常在我开始尝试实施插页式广告时出现。我似乎在尝试实施插页式广告时遇到了很多麻烦,而且我已经阅读了很多教程。我不知道我做错了什么:(有人可以帮忙吗?
此致,
瑞安
setShowsFPS:
是 SKView
上的方法,但不是 UIView
上的方法。
虽然我在您发布的代码中看不到原因,但该错误意味着 UIView
实例正在传递给需要 SKView
的方法。设置一个异常断点来尝试找出位置。触发调用的可能不是您的代码。
我在这部分代码中不断收到错误消息:
// Interstitial iAd
-(void)showFullScreenAd {
// Check if already requesting ad
if (requestingAd == NO) {
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[self requestInterstitialAdPresentation];
NSLog(@"interstitialAdREQUEST");
requestingAd = YES;
}
}
-(void)interstitialAd:(ADInterstitialAd *)interstitialAd didFailWithError:(NSError *)error {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAd didFailWithERROR");
NSLog(@"%@", error);
}
-(void)interstitialAdDidLoad:(ADInterstitialAd *)interstitialAd {
NSLog(@"interstitialAdDidLOAD");
if (interstitialAd != nil && interstitial != nil && requestingAd == YES) {
//[interstitial presentFromViewController:self];
//[interstitial presentInView:self.view] // I get an error on this line
NSLog(@"interstitialAdDidPRESENT");
if (interstitial.loaded) {
[self requestInterstitialAdPresentation]; //I also get an error on this line too
}
}
}
-(void)interstitialAdDidUnload:(ADInterstitialAd *)interstitialAd {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidUNLOAD");
}
-(void)interstitialAdActionDidFinish:(ADInterstitialAd *)interstitialAd {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidFINISH");
}
这与特定行有关:
[self requestInterstitialAdPresentation];
这是我遇到的错误,我不知道需要将此行更改为什么才能停止错误:
-[UIView setShowsFPS:]: unrecognized selector sent to instance 0x146e241a0
我过去在使用相同类型的代码时遇到过这个错误,它通常在我开始尝试实施插页式广告时出现。我似乎在尝试实施插页式广告时遇到了很多麻烦,而且我已经阅读了很多教程。我不知道我做错了什么:(有人可以帮忙吗?
此致,
瑞安
setShowsFPS:
是 SKView
上的方法,但不是 UIView
上的方法。
虽然我在您发布的代码中看不到原因,但该错误意味着 UIView
实例正在传递给需要 SKView
的方法。设置一个异常断点来尝试找出位置。触发调用的可能不是您的代码。