【问题标题】:AppLovin integration using delegates in ios 8/swift在 ios 8/swift 中使用委托进行 AppLovin 集成
【发布时间】:2014-11-11 23:04:03
【问题描述】:

我正在尝试在我的 SKScene 中添加 Applovin 代表。当我添加 AlAdLoadDelegate 作为委托,xcode 向我显示此错误

类型“GameScene”不符合协议“ALAdLoadDelegate”

所以我想我必须手动添加一个协议。但我不知道怎么做 快速转换它

@protocol ALAdLoadDelegate <NSObject>
-(void)adService:(ALAdService *)adService didLoadAd:(ALAd *)ad;
-(void)adService:(ALAdService *)adService didFailToLoadAdWithError:(int)code;
@end

这就是我在我的 SKScene 中添加 AlAdLoadDelegate 的方式...

class GameScene: SKScene, GKGameCenterControllerDelegate,SKPhysicsContactDelegate, ALAdLoadDelegate {

.... My code

}

谁能帮我在 ios8 中集成 Applovin 或告诉我如何解决这些问题?

【问题讨论】:

    标签: swift ios8 applovin


    【解决方案1】:

    你的 GameScene 不符合协议,因为它需要实现这两个方法(它们不是可选的)。

    如果您开始在您的类实现中输入“adService”,您应该会看到在 Swift 中转换的此方法的代码完成 (alt+esc)。

    第一个方法在 Swift 中是这样的。

    func adService(adService: ALAdService, didLoadAd ad: ALAd) {
    
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      相关资源
      最近更新 更多