Upon receipt of the contents of the csv file, nil is returned. However, reducing the csv table to 10 rows will work correctly, displaying the contents of the csv file.
The original csv has about 400,000 characters arranged in 500 rows and 11 columns. What can make it return null with the original csv?
let dbPath = "/Volumes/Gios2TWD/myDB.csv"
var error: NSError?
let csvContent = NSString(contentsOfFile: dbPath, encoding:NSUTF8StringEncoding, error: &error) as String!
println(csvContent)
println(error)
I am running Xcode Version 6.1 (6A1030)
error:
Optional (Error Domain = NSCocoaErrorDomain Code = 261 "File" myDB.csv "cannot be opened using Unicode text encoding (UTF-8)." UserInfo = 0x10050c5b0 {NSFilePath = / Volumes / Gios2TWD / myDB.csv, NSStringEc })
source
share