本文介绍了RxTest:体系结构x86_64和arm64的未定义符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正尝试从 Raywenderlich RxSwift 本书:
I am trying to run the following test from Chapter 16: Testing with RxTest of Raywenderlich RxSwift book:
import XCTest
import RxSwift
import RxTest
@testable import Testing
class TestingViewModel : XCTestCase {
var viewModel: ViewModel!
var scheduler: ConcurrentDispatchQueueScheduler!
override func setUp() {
super.setUp()
viewModel = ViewModel()
scheduler = ConcurrentDispatchQueueScheduler(qos: .default)
}
func testColorNameIsRayWenderlichGreenWhenHexStringIs006636() {
// 1
let colorNameObservable = viewModel.colorName.asObservable().subscribeOn(scheduler)
// 2
viewModel.hexString.value = "#006636"
// 3
XCTAssertEqual("rayWenderlichGreen", try! colorNameObservable.toBlocking().first()!)
}
}
但是我在模拟器上收到此错误:
But I get this error on the simulator:
iPhone 6s上的这个:
And This one on iPhone 6s:
推荐答案
经过大量搜索,有人建议此处对于另一个类似的问题,我发现通过导入RxCocoa
可以解决此错误.
After a lot of searches, As somebody suggests here for another similar issue I found that this error will be solved by importing RxCocoa
.
这篇关于RxTest:体系结构x86_64和arm64的未定义符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!