如果.m文件中使用了weak關(guān)鍵字,在重寫時(shí)會(huì)報(bào)cannot create _weak reference because the current deployment target does not support weak references 。
解決辦法為用下面的方法重寫:
clang -rewrite-objc -fobjc-arc -fobjc-runtime=macosx-10.14 main.m
其中macosx-10.14 為你本機(jī)的sdk版本。