title: How do I get each line from an NSString?
body: <p>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.</p>
  
  <p>In 10.5 I did this:</p>
  
  <pre><code>NSArray* lines = [str componentsSeparatedByCharactersInSet: [NSCharacterSet newlineCharacterSet]];
  </code></pre>
  
  <p>But that doesn't work in 10.4, and my program needs to work in 10.4.</p>
  
  <p>As well, it needs to work with \r, \n and \r\n line endings. </p>