title: Selected Values are not storing in AddObject in didSelectRow
body: <p>Selected objects are not saving in addObject in didSelectRowAtIndex and I need to pass that array in another view controller.</p>
  
  <pre><code>@implementation nextViewController
  {
      NSArray *tableData;
      NSArray * arrayfortable;
      NSMutableArray * selectedIndexpath;
  }
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  { 
      UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
  
      NSMutableArray *selectedIndexpath = [[NSMutableArray alloc]init];
      selectedIndexpath = [selectedIndexpath arrayByAddingObject:[tableData objectAtIndex:indexPath.row]];
  
      NSLog(@"selected",selectedIndexpath);
  
      if (cell.accessoryType == UITableViewCellAccessoryNone) {
          cell.accessoryType = UITableViewCellAccessoryCheckmark;
          __selectedPath = indexPath;
      } else {
          cell.accessoryType = UITableViewCellAccessoryNone;
          __selectedPath = nil;
      }
  }
  </code></pre>