I'm currently trying to take a text file and go through it line by line, creating an array of strings where each element represents a line of the text file. The following is my current code:
let file = String(contentsOfURL: selectedfile!, encoding: NSUTF8StringEncoding, error: nil)!
let FileArray = file.componentsSeparatedByString("\r\n")
Unfortunately when I run the program, instead of an array of 50 elements or so, I get an array of '106652628048000' elements, where the first one is the entire contents of the text file.
The other elements are mostly blank strings, and some have odd characters that seem to be related to formatting. What am I doing wrong?