1. 程式人生 > >在Playground中使用RxSwift出錯的解決方法

在Playground中使用RxSwift出錯的解決方法

最近在學習Raywenderlich的RxSwift視訊教程,當我在Playground中使用RxSwift時,出現錯誤:

Playground execution failed:

error: Couldn’t lookup symbols:
__T07RxSwift14ObservableTypePAAE2ofAA0C0Cy1EQzGSayAHGd_AA018ImmediateSchedulerD0_p9schedulertFZ
__T07RxSwift10ObservableCMa
_T07RxSwift14ObservableTypePAAE4fromAA0C0Cy1EQzGSayAHG_AA018ImmediateSchedulerD0_p9schedulertFZfA0


__T07RxSwift14ObservableTypePAAE4justAA0C0Cy1EQzGAHFZ
__T07RxSwift10ObservableCyxGAA0C4TypeAAlWa
_T07RxSwift14ObservableTypePAAE2ofAA0C0Cy1EQzGSayAHGd_AA018ImmediateSchedulerD0_p9schedulertFZfA0
__T07RxSwift14ObservableTypePAAE4fromAA0C0Cy1EQzGSayAHG_AA018ImmediateSchedulerD0_p9schedulertFZ

最終我通過修改Podefile解決了此問題:

platform :ios, ‘11.0’

target ‘RxSwiftPlayground’ do use_frameworks!
# Pods for RxSwiftPlayground pod ‘RxSwift’, ‘~> 4.0’ end

post_install do |installer|

installer.pods_project.build_configurations.each do |config|
    config.build_settings.delete('CODE_SIGNING_ALLOWED')
    config.build_settings.delete('CODE_SIGNING_REQUIRED')
end

installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['CONFIGURATION_BUILD_DIR'] = '$PODS_CONFIGURATION_BUILD_DIR'
    end
end 
end

重新pod install,playground就正常了。