After updating to Xcode 7.3, it throws the error Cannot create __weak reference in file using manual reference counting in pod files. Has anyone solved this iss
The best way to solve this is to add a post_install script to your Podfile that sets the Weak References in Manual Retain Release flag to yes in all your pod targets. To do that just paste the following code at the bottom of your Podfile.
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_OBJC_WEAK'] ||= 'YES'
end
end
end
Sometimes, doing that result in the error -fobjc-weak is not supported on the current deployment target. You can solve that by adding another configuration option, forcing all the pods to target the version you want (based on this answer):
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_OBJC_WEAK'] ||= 'YES'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.3'
end
end
end