title: Creating a CSV file using Core Data
body: <p>I have a core data app that displays its data in a tableView.  I know how to create a CSV file, and I am using the following code in cellForRowAtIndexPath while my table is being created:</p>
  
  <pre><code>outputStringToCSV = [outputStringToCSV stringByAppendingFormat:@"%@ ,%@ ,%@ \n", punchitem.punchitemRoomNumber, punchitem.punchitemRoomName, punchitem.punchitemDescription];
  
  NSLog(@"=== OUTPUTSTRING: %@", outputStringToCSV);
  </code></pre>
  
  <p>My outputStringToCSV is a NSString and my intent is to save the formatted string to a CSV file.  </p>
  
  <p>The problem is every time the tableView reloads when information or a predicate is changed, the size of the outputStringToCSV gets appended and bigger and bigger with repeated information.  Should my outputStringToCSV go somewhere else other than cellForRowAtIndexPath?  Is there some better way to collect the info from my table and load it into a CSV file?</p>
  
  <p>I'm not sure what direction to go now and would appreciate any help.  Thanks!</p>