Xcode 7.3 cannot create __weak reference in file using manual reference counting

Set Build Settings -> Apple LLVM 7.1 - Language - Objective C -> Weak References in Manual Retain Release to YES.

Visual example

Taken from Apple Developers Forums - Xcode 7.3b4, non-arc, cannot create __weak reference.


This is official answer from Apple from the link:

This issue behaves as intended based on the following: We are in the process of implementing weak references in all Objective-C language modes. Since “__weak” has historically been ignored in non-ARC (and non-GC) language modes, we’ve added this error to point out places where the semantics will change in the future. Please update your bug report to let us know if this is still an issue for you.

So basically, if you are using Pod for 3rd party libraries, you have to either delete __weak in non-ARC or wait for update.

Update @ 3/23

I should've research more about flags that I can pass to complier in order to bypass these kinda stuffs. But fundamentally you should not use __weak in non-ARC mode from now to avoid any unexpected conflicts. For cocoapods users, you do not need to delete __weak or wait for update but set Weak References in Manual Retain Release flag in build settings to YES like Lean said. Hope this help.