RxSwift-操场执行失败:无法查找符号

时间:2019-01-09 10:04:16

标签: ios swift cocoapods rx-swift swift-playground

我创建了一个新项目,并使用pod安装RxSwift。然后,我创建了一个游乐场并编写了以下代码:

import UIKit
import RxSwift
import PlaygroundSupport

var name = "hello"
let names = Variable(["Good"])  

但是控制台显示此错误:

  

操场执行失败:

     

错误:无法查找符号:__ T07RxSwift8VariableCACyxGxcfC
  __T07RxSwift8VariableCMa

1 个答案:

答案 0 :(得分:1)

改为尝试使用Podfile

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

  1. 删除“ import RxSwift”行
  2. 清洁(Cmd + Shift + K)
  3. 构建(有错误)
  4. 放回“ import RxSwift”

来自https://github.com/ReactiveX/RxSwift/issues/1660