更新7.3后编译可能会出现这个错。
官方的回答在这里:https://forums.developer.apple.com/thread/38934
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.
另外一个回答提到:
1 doesn’t apply to MRR, because you just don’t retain the variable anyway.
2 doesn’t apply to MRR either, because the runtime support is in GC and ARC, which you’re not using.
简而言之,现在的runtime和GC中会处理这种情况下的引用。不要再指明__weak了。所以删除掉就可以了。