title: getting NSArray length/count - Objective C
body: <p>Well I've looked at similar problems over the site but haven't reached a solution thus far so I must be doing something wrong.</p>
  
  <p>Essentially, I am importing a text file, then splitting each line into an element of an array. Since the text file will be updated etc.. I won't every know the exact amount of lines in the file and therefore how many elements in the array. I know in Java you can do .length() etc.. and supposedly in Objective C  you can use 'count' but i'm having no luck returning the length of my array... suggestions?</p>
  
  <blockquote>
  <pre><code> NSString *filePath = [[NSBundle mainBundle] pathForResource:@"allshows" 
                                                       ofType:@"txt"];
  </code></pre>
  </blockquote>
  
  <pre><code> NSString *fileString = [NSString stringWithContentsOfFile:filePath];
  
  NSArray *lines = [fileString componentsSeparatedByString:@"\n"];  
  
  NSUInteger *elements = [lines count];
  NSLog(@"Number of Shows : ", elements);
  </code></pre>
  
  <p>and what is being output is NOTHING. as in "Number of Shows :  " - blank, like it didn't even count at all.</p>
  
  <p>Thank you for any help!</p>