RxCocoa版本3.6.1无法在Xcode 9中构建,并显示错误消息:
Initializer 'init(parentObject:)' with Objective-C selector 'initWithParentObject:' conflicts with initializer 'init(parentObject:)' from superclass 'RxScrollViewDelegateProxy' with the same Objective-C selector
答案 0 :(得分:2)
这似乎是由@objc推断引起的。奇怪的是,关闭Swift 3风格的@objc推理似乎解决了这个问题。把它放在Podfile的末尾:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
if target.name == 'RxCocoa' then
config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'Off'
end
end
end
end
这将设置所有使用Swift 3.2构建的Pod,禁用RxCocoa的@objc推理。