コンパイルしようとすると、Xcodeで "segmentation fault 11"が表示されます。これは私のコードです:コードで間違っセグメンテーションフォールト11 Xcodeでコンパイルするとき8.3
1. While type-checking 'startImport' at /Users/Jaime/Developer/ETA/ETA/Model Controllers/DataImportController.swift:13:5
2. While type-checking declaration 0x7fb185b34948 at /Users/Jaime/Developer/ETA/ETA/Model Controllers/DataImportController.swift:17:17
3. While type-checking expression at [/Users/Jaime/Developer/ETA/ETA/Model Controllers/DataImportController.swift:17:32 - line:17:90] RangeText="fileContents.components(separatedBy: CharacterSet.newLines)"
何か:
import Foundation
import UIKit
class DataImportController {
func startImport() {
if let dataPath = Bundle.main.path(forResource: "stops", ofType: "csv") {
do {
let fileContents = try String(contentsOfFile: dataPath, encoding:.utf8)
let contents = fileContents.components(separatedBy: CharacterSet.newLines)
} catch {
print(error)
}
}
}
}
これは、メッセージダンプのですか?
ありがとうございます。
"コンパイルしようとすると"セグメンテーションフォルトが11になります "このようなフォルトは常にバグと見なされます。 http://bugs.swift.orgで報告してください。 – matt