If I have an NSString with a text file in it, how do I get an NSArray of NSString with each NSString containing a line of the file.
In 10.5 I did this:
NSArray* lines = [str componentsSeparatedByCharactersInSet: [NSCharacterSet newlineCharacterSet]];
But that doesn’t work in 10.4, and my program needs to work in 10.4.
As well, it needs to work with \r, \n and \r\n line endings.
The following code is straight from Apple’s documentation regarding paragraphs and line breaks:
I’m not 100% sure if it will work with 10.4