我的GameScene中有我的插页式广告的代码,每次他们应该被调用时,我都会在标题中看到错误:
func interstitialAdDidLoad(interstitialAd: ADInterstitialAd!) {
iAdInterstitialView = SKView()
iAdInterstitialView.frame = self.view!.bounds //This line
view?.addSubview(iAdInterstitialView)
interstitialAd.presentInView(iAdInterstitialView)
UIViewController.prepareInterstitialAds()
}
还有其他人有这个问题并修复过吗?先感谢您。
答案 0 :(得分:1)
这意味着nil
中展开的值为self.view!
。
你可以这样检查:
if let view = self.view {
iAdInterstitialView.frame = view.bounds
}