In my iOS app, I have it set to read a .txt file from the resources folder, and create an NSArray from each line of text. However, when I try this, the NSArray returns empty.
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"LUKEQUESTIONSPLAINTEXTFILE" ofType:@"txt"];
NSData* data = [NSData dataWithContentsOfFile:filepath];
NSString* string = [[NSString alloc] initWithBytes:[data bytes]
length:[data length]
encoding:NSUTF8StringEncoding];
NSArray *listArray = [string componentsSeparatedByString:@"\n"];
NSLog(@"HERE IT IS: %@", listArray);
Moreover, if I do a lot for the entire string, it stops after the very first line break. What am I doing wrong? The file is only 214 bytes.