sharedapplication is unavailable not available on ios app extension

今天在github上下载一个项目遇到了这样一个问题:
sharedapplication is unavailable not available on ios app extension
问题是使用了AFNetworking的扩展,导致编译不通过,在网上查了很久终于找到解决办法,在Podfile中增加下面的代码就可以解决问题:



post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
end

你可能感兴趣的:(sharedapplication is unavailable not available on ios app extension)