title: How do I remove the file extension from a list of files in an NSArray in iOS 5
body: <p>Working in iOS 5 I have read a list of file names from my documents directory the array is called "file list". I am trying to get a list of file names without extensions. Only the last name in my list has the extension removed. Any ideas?</p>
  
  <pre><code>- (IBAction)getFile:(id)sender
  {  
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory =[paths objectAtIndex:0];
      NSArray *fileList = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:nil];
      NSString *names = [[[fileList valueForKey:@"description"]componentsJoinedByString:@"\n"]stringByDeletingPathExtension];
  
      NSLog(@"File Name Is \n%@",names);    
      showFile.text = names; 
  }
  </code></pre>