title: How to keep track of selected indexes (in array) in a UITableViewController Which contains another UITableView as its Cells
body: <p>with the help of <a href="http://www.raywenderlich.com/4723/how-to-make-an-interface-with-horizontal-tables-like-the-pulse-news-app-part-2" rel="nofollow">THIS Tutorial</a> . . . .</p>
  
  <p>I made a UITableViewController (for reference I can call it MainTableVC)
  , which has single row in each of its section
  and 
  I made every cell of this UITableViewController(MainTableVC) a UITableView (for reference I can call it UITableViewOfMainTableVCell) with many cells.</p>
  
  <p>Now I rotated Cell/rows of UITableViewOfMainTableVCell {* its a UITableView not a UITableViewCell },
  so that i could scroll cells of UITableViewOfMainTableVCell horizontally.</p>
  
  <p>now my UI looks like this,
  I have a table with 10 section(say), each section has one row/cell and in this row/cell i have several rows/cells which can be scrolled horizontally</p>
  
  <p>I also enabled allowMultipleSelections in custom cells of UITableViewOfMainTableVCell</p>
  
  <p>Now <code>I wanted to keep track of selected indexes of selected rows</code>
  so 
  I took an NSArray and saved indexPaths in it with this delegate method of UITableViewOfManiTableVCcells</p>
  
  <pre><code>-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
  NSMutableArray *selectedIndexesOfOneRow = [NSMutableArray arrayWithArray:[tableView indexPathsForSelectedRows]];
  NSLog(@"number of selected Indexes = %d",[selectedIndexesOfOneRow count]);
  }
  
  -(void)tableView:(UITableView *)tableView didDeSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
  NSMutableArray *selectedIndexesOfOneRow= [NSMutableArray arrayWithArray:[tableView indexPathsForSelectedRows]];
  NSLog(@"number of selected Indexes = %d",[selectedIndexesOfOneRow count]);
  }
  </code></pre>
  
  <p><strong>MY PROBLEM</strong> :-</p>
  
  <p>suppose if I select 4 cells/rows in a row/cell of MainTableVC
  the NSMutableArray *selectedIndexesOfOneRow has the right count
  BUT
  if I select cells of another a row in another section of MainTableVC with even keeping previous cells selected
  the count starts from beginning </p>
  
  <p>the problem is with indexPathsForSelectedRows,
  it only keeps track of Selected Rows of single UITableView,
  since i have separate UITableViews for each Row of Each Section of MainTableVC
  NSMutableArray always gets reset when select cells from different row</p>
  
  <p><strong>MY QUESTION</strong></p>
  
  <p>since every Row/Cell calls the same UITableView delegate method, 
  how will I prevent it, 
  I want to store all the selected indexes of cells in whole UI</p>
  
  <p>I could make an array of array to store indexes of different different indexes
  but how would i get those differently </p>
  
  <p>"HINT"
  I could do somthing like this, 
  in my MainTableVC, 
  Since i have a tableView inside Cell of MainTableVC i can put an NSArray *array = [cell.tableView indexPathsOfSelectedIndex], but again in which delegate method of MainTableVC should i put this, and also i have checked, Since i am not selecting any whole row of MainTableVC(UITableViewController), its delegate methods didSelectRowAtIndexPath and didDeSelectRowAtIndexPath never get called </p>