【问题标题】:MoPub Full SDK 3.0.0 IntegrationMoPub 完整 SDK 3.0.0 集成
【发布时间】:2014-10-02 20:22:34
【问题描述】:

关于新的MoPub iOS SDK 3.0.0 及其Getting Started 文档:

  1. 下载 MoPub SDK
  2. 将 SDK 添加到您的 Xcode 项目中。
  3. ...

在第 2 步中,Unity 3D 生成 MRC Xcode 项目并且 MoPub 文档说:

If your application uses Manual Reference Counting (MRC) you must tell the compiler to build the MoPub iOS SDK source files with ARC.

所有 SDK 文件的编译器标志都设置为 -fobjc-arc。然后出现了两个新问题:

  1. "Cannot use '@try' with Objective-C exceptions disabled" Error 已通过在项目的构建设置中启用 Objective-C 异常来修复;和
  2. '__weak' only applies to Objective-C object or block pointer types; 来自文件 MPStreamAdPlacer.m(见附件截图)。

由于文档未涵盖上述问题,我该如何修复这些最后的编译错误?

注意:适用于 MoPub iOS SDK 2.4.0

【问题讨论】:

    标签: xcode unity3d automatic-ref-counting integration mopub


    【解决方案1】:

    问题:https://github.com/mopub/mopub-ios-sdk/issues/82

    khchen428 说:

    感谢您报告此问题!我们很快就会解决。同时,这里有一个解决方法: 在MoPubSDK/Native Ads/MPStreamAdPlacer.m 从第 156 行开始:

    替换: __weak typeof(self) weakSelf = self; 和: __typeof__(self) __weak weakSelf = self;

    并替换: typeof(self) strongSelf = weakSelf; 和: __typeof__(self) strongSelf = weakSelf;

    【讨论】:

    • 当前版本还没有修复
    【解决方案2】:

    我删除了行:

    __weak typeof(self) _weakSelf = self;
    

    typeof(self) strongSelf = _weakSelf;
    

    并将所有引用 strongSelf 替换为 self

    对我有用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-20
      • 2013-12-06
      • 1970-01-01
      • 1970-01-01
      • 2021-02-26
      相关资源
      最近更新 更多