0
下面的代碼導致在Xcode IDE失敗,並拋出swiftc分段錯誤(11):斯威夫特分段故障11由於變量的作用域
func testDeviceWillNotify()
{
let expectation = expectationWithDescription("Will be ready.")
class FooMock: Foo
{
func accessoryDidConnect()
{
expectation.fulfill()
}
}
// ...
}
如果我註釋掉expectation.fulfill()
一切工作正常。我也嘗試過expectation!
和expectation?
,但是任何對expectation
的引用都會導致Xcode崩潰。
使用Xcode 6.1(6A1052d)及其非常令人沮喪。有沒有人知道解決這個bug的方法?即使以另一種方式編寫測試也不得不做。
工程。但現在一些其他完全無關的代碼導致swiftc崩潰與退出代碼1與「全球是外部的,但沒有外部或弱聯動!」,哦... ... - – 2014-11-05 03:26:11