title: Reading from text file - Objective C
body: <p>I am trying to familiarize myself with objective C, and my current goal is to read a list of items in a text file and store them in a NSString array.</p>
  
  <p>Currently this is what I have:</p>
  
  <pre><code>NSString *filepath = [[NSBundle mainBundle] pathForResource:@"myList" ofType:@"txt"];
  NSData* data = [NSData dataWithContentsOfFile:filepath];
  NSString* string = [[NSString alloc] initWithBytes:[data bytes]
                                               length:[data length]
                                             encoding:NSUTF8StringEncoding];
  
  NSString* delimiter = @"\n";
  listArray = [string componentsSeparatedByString:delimiter];
  </code></pre>
  
  <p>I am not sure if this matters, but <code>myList.txt</code> is in my Supporting Files.</p>
  
  <p>At the moment, I only have one item in my list. However I am unable to store even that 1 item into my <code>listArray</code>.</p>
  
  <p>I am sure it is something silly that I am missing, I am just new to Objective C.</p>
  
  <p><strong>EDIT:</strong>
  I apologize for not mentioning this earlier. I AM NOT receiving any sort of error. My array is just null.</p>