在用 pod 依赖 dsBridge
项目后报错如下:
Error:(72, 13) cannot synthesize weak property because the current deployment target does not support weak references
猜测原因是dsBridge
没有指定运行最低版本,导致不支持 weak 属性。
https://github.com/wendux/DSBridge-IOS/blob/master/dsBridge.podspec
解决方案:
在 Podfile
下面添加如下代码:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if target.name == 'dsBridge'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '7.0'
end
end
end
end