代码之家  ›  专栏  ›  技术社区  ›  JamesG

无法将ViewController类型的值分配给GADInterstialDelegate类型?

  •  0
  • JamesG  · 技术社区  · 10 年前

    我四处寻找了答案,但似乎找不到一个 GAD国际代表

    我正在遵循教程: https://developers.google.com/admob/ios/interstitial 但我得到的只是这个错误:

    无法将ViewController类型的值分配给GADInterstialDelegate类型?

    我已删除项目并重新开始。有人能帮忙吗?

    1 回复  |  直到 10 年前
        1
  •  5
  •   Community Mohan Dere    6 年前

    取自: Swift AdMob Tutorial

    原因

    这意味着您的ViewController不符合GADInterstialDelegate类型

    解决方案

    将ViewController类声明更改为:

    class ViewController: UIViewController {
    

    为此:

    class ViewController: UIViewController, GADInterstitialDelegate