以下代码给出了错误
在'do-while'循环中预期'while'
if let path = NSBundle.mainBundle().pathForResource("Chapters", ofType: "txt"){
do {
let stringFromFile = try String(contentsOfFile:path, encoding: NSUTF8StringEncoding)
var chapters: [String] = stringFromFile.componentsSeparatedByString("@")
chapters.removeAtIndex(0)
} catch {
print((error))
}
}
之前它工作正常,但现在它给了我一个错误。有谁知道为什么?