title: add columns to a table based on core data readout in specific order
body: <p>The situation:</p>
  
  <p>there are two tables, a main table and a secondary table. the main table is connected to a core data database.
  i have set up the core data and the main table just like i wanted it.. everything is working fine and i am happy about it. </p>
  
  <p>now i have to add the columns to the second table. 
  basically the second tableview has a single column (image &amp; text table cell view). i would need to add a column for each row of the first tableview (the one conected with the core data's array controller) as a checkbox column, and the header of this column should have the value stored in arrangedobjects.header. but this is not it. these new columns should be in a specific order: ascending order, based on the arrangedobjects.order value from the first table. </p>
  
  <p>this should be executed whenever i hit a update button on the interface.</p>
  
  <p>so the questions are:</p>
  
  <p>-how can i add columns to the second table view based on the number of rows of the first tableview?</p>
  
  <p>-how can i order the columns based on the value stored in a column from the first tableview?</p>
  
  <p>-how can i set the column to a checkboxcolumn programatically?</p>
  
  <p>-how can i programmatically set the column header to a value stored in the arraycontroller?</p>
  
  <p>example of the desired result:</p>
  
  <p>TABLE 1 (connected to core data)</p>
  
  <pre><code> somecolumn | header | order | somecolumn | somecolumn
   ------------------------------------------------------
   text        hd1       3       text         text
   text        hd3       1       text         text
   text        hd4       7       text         text
  </code></pre>
  
  <p>Structure of TABLE 2: (all checkbox columns except the first, column order based on "order" field of TABLE 1, column header based on "header" filed of TABLE 1)</p>
  
  <pre><code> existingcolumn | hd3 | hd1 | hd4
  </code></pre>
  
  <p>again, PLEASE be as clear as possible.</p>
  
  <p>thank you</p>
  
  <p>Best regards </p>
  
  <p>Igor</p>
  
  <p><em>I already made a similar question in the past, but this one has way more content in it, thats the reason why i am starting a new one. i searched the web and found no answer to this specific question. also please keep in mind that i am a newbie at objective-c/cocoa programming so please be clear in your answers.</em></p>