title: Reading from text file in objective-c
body: <p>I have a textfile which consists of multiple words. They are all separated by new lines.</p>
  
  <p>What Ive tried:</p>
  
  <pre><code>NSString *filePath = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"txt"];
  
  if (filePath) { // This does trigger, so the file is actually found.
  
      NSArray *arr = [filePath componentsSeparatedByString:@"\n"]; 
  
  }
  </code></pre>
  
  <p>What Ive also tried:</p>
  
  <pre><code>NSMutableArray * lines = [[NSMutableArray alloc] initWithArray:[filePath componentsSeparatedByString:@"\n"] copyItems: YES];
  </code></pre>
  
  <p>Neither of these seems to work as I only seem to get the filepath when I read out lines using NSLog. Can any of you help?</p>
  
  <p>The lines array only seem to consist of one object, the string of the location of the textfile.</p>
  
  <p>I want an array where each string is a string separated by a line in the textile.</p>