title: Add Header to CSV file
body: <p>Part of my iOS app will include exporting a .csv file.</p>
  
  <p>I have the file made and data is added to each row as I would like.</p>
  
  <p>I would like to add a header row so if a file is emailed to a person they will know what each column is for.</p>
  
  <p>How do I implement something like this?</p>
  
  <p>Here is my csv code below:</p>
  
  <pre><code>- (NSString *)dataFilePath
  {
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
      return [documentsDirectory stringByAppendingPathComponent:@"myfile.csv"];
  }
  
  - (IBAction)save:(id)sender
  {
      if (![[NSFileManager defaultManager] fileExistsAtPath:[self dataFilePath]]) {
          [[NSFileManager defaultManager] createFileAtPath: [self dataFilePath] contents:nil attributes:nil];
      }
  
      NSString * writeString = [NSString stringWithFormat:@"%@,%@,%@\n", self.nameTextField.text, self.cityTextField.text, self.stateTextField.text];
  
      NSFileHandle *handle;
      handle = [NSFileHandle fileHandleForWritingAtPath: [self dataFilePath]];
      [handle truncateFileAtOffset:[handle seekToEndOfFile]];
      [handle writeData:[writeString dataUsingEncoding:NSUTF8StringEncoding]];
  
      self.nameTextField.text = @"";
      self.cityTextField.text = @"";
      self.stateTextField.text = @"";
  
      [self.stateTextField resignFirstResponder];
  }
  </code></pre>
  
  <p>Questions 2:</p>
  
  <p>How can I write over a row? Currently if I update any of the <code>UITextFields</code> a new row is added.</p>