2015-02-09 59 views
1

我cannotadd ADInterstitialAdDelegate上我的課它說,它不符合協議...雨燕「SceneName」不符合協議ADInterstitialAdDelegate - SK斯威夫特

import SpriteKit 
import AVFoundation 
import iAd 

var classicHScore: AnyObject? =  NSUserDefaults.standardUserDefaults().objectForKey("classicHighscore") 
var classicHScoreInt = classicHScore! as Int 
var interstitialAd = ADInterstitialAd() 

class SpeedGameScene: SKScene, SKPhysicsContactDelegate, ADBannerViewDelegate, ADInterstitialAdDelegate { 

不知道爲什麼我無法找到答案谷歌,但我敢肯定你brainiacs之一將有答案

我使用精靈套件

回答

3

你忘了添加所需的委託的方法。如果發生此類錯誤,請檢查the documentation of the Delegate並檢查所需的方法。這些方法標有要求

class SpeedGameScene: SKScene, SKPhysicsContactDelegate, ADBannerViewDelegate, ADInterstitialAdDelegate { 
    func interstitialAdDidUnload(interstitialAd: ADInterstitialAd!) { 

    } 

    func interstitialAd(interstitialAd: ADInterstitialAd!, didFailWithError error: NSError!) { 

    } 
} 
+0

完美 - 它是漫長的一天忽略了部分 - 明星! – LukeTerzich 2015-02-09 22:55:17