2

Regarding the new MoPub iOS SDK 3.0.0 and its Getting Started documentation:

  1. Download the MoPub SDK
  2. Add the SDK to your Xcode project.
  3. ...

During step 2, as Unity 3D generates MRC Xcode projects and the MoPub documentation says:

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

All SDK files had their compiler flags set to -fobjc-arc. Then two new issues appeared:

  1. "Cannot use '@try' with Objective-C exceptions disabled" Error which was fixed by Enabling Objective-C Exceptions inside project's build settings; and
  2. '__weak' only applies to Objective-C object or block pointer types; from file MPStreamAdPlacer.m (see attached screenshots).

MoPubMRCIntegrationError1.jpg MoPubMRCIntegrationError2.jpg

As the documentation does not cover the above described issues, how can I fix these last compiling errors?

NOTE: Works fine with MoPub iOS SDK 2.4.0.

3

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

khchen428 said:

Thanks for reporting this issue! We'll have a fix out soon. In the mean time, here is a workaround: In MoPubSDK/Native Ads/MPStreamAdPlacer.m starting at line 156:

replace: __weak typeof(self) weakSelf = self; with: __typeof__(self) __weak weakSelf = self;

and replace: typeof(self) strongSelf = weakSelf; with: __typeof__(self) strongSelf = weakSelf;

  • 1
    it's still not fixed in the current version – Matthieu Rouif Oct 4 '15 at 20:54
1

I deleted lines:

__weak typeof(self) _weakSelf = self;

and

typeof(self) strongSelf = _weakSelf;

and replaced all references strongSelf by self

it works for me

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.