查看某个.m文件的 编译后的.cpp文件
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc xxx.m
如果.m文件中包含__weak 的代码就会报错
error: cannot create __weak reference because the current deployment target does not support weak references
__attribute__((objc_ownership(weak))) NSString *name = @"xxx";
^
1 error generated.
则需要如下改动, 指定ARC,和runtime的版本
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc -fobjc-arc -fobjc-runtime=ios-8.0.0 xxx.m
网友评论