let path = NSBundle.mainBundle().pathForResource("file", ofType: "log")
var text = String(contentsOfFile: path!, encoding: NSUTF8StringEncoding, error: nil)!
var textArr = text.componentsSeparatedByString("\n")
var rad: String = textArr[n]
....
println(rad)
label.text = "\(label.text) \(rad)"
在Xcode Output窗口中,我得到了这个:
CORRECT LINE
NEXT LINE
在模拟器中的标签字段中,我得到了这个:
Optional("Optional("Optional(\\\"\\\")
CORRECT LINE\\r\") NEXT LINE \r")
我希望标签字段看起来像Xcode中的输出,所有这些可选的\\" r -stuff来自哪里?