如何在使用Sprite Kit时启用iAd? [英] How can I enable iAd when using Sprite Kit?
问题描述
在IOS 7中,我们可以在使用时轻松启用iAd:
In IOS 7, we can enable iAd very easy when using:
self.canDisplayBannerAds = YES;
self.canDisplayBannerAds = YES;
但是,我无法使用此在我的ViewController(加载SKScene的ViewControl)中。加载时我的游戏崩溃了。
However, I cannot use this in my ViewController (the ViewControl that load SKScene). My game is crash when loading.
那么我如何在游戏中激活iAd(使用Sprite Kit)?
So how can I active iAd in my game (using Sprite Kit)?
推荐答案
您只能在UIViewController子类中显示iAd。你做得对。将以下代码放在UIViewController中,而不是放在SKScene中。
You can only show iAd in a UIViewController subclass. You are doing it right. Put the following code in your UIViewController and not in the SKScene.
请参考本教程中的确切代码: http://tutorials.veasoftware.com/2013/10/10/how-to-add-iads/
Please refer to this tutorial for the exact code: http://tutorials.veasoftware.com/2013/10/10/how-to-add-iads/
这篇关于如何在使用Sprite Kit时启用iAd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!