2014-10-02 36 views
2

关于新MoPub iOS SDK 3.0.0及其Getting Started文档:MoPub完整的SDK 3.0.0集成

  1. 下载MoPub SDK
  2. 的SDK加入您的Xcode项目。
  3. ...

在步骤2中,作为统一的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. ​​来自文件MPStreamAdPlacer.m(见附件截图)。

MoPubMRCIntegrationError1.jpg MoPubMRCIntegrationError2.jpg

由于文档不包括上述的问题,我怎么能解决这些最后的编译错误?

注意:适用于MoPub iOS SDK 2.4.0

回答

3

问题: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;

+1

它仍然在当前版本中不固定 – 2015-10-04 20:54:10

1

我删除线:

__weak typeof(self) _weakSelf = self; 

typeof(self) strongSelf = _weakSelf; 

自行更换了所有引用strongSelf

它为我工作