title: How to play a video when tapping a cell?
body: <p>I want to open a video when i tap the first cell, and i want to open an other video when im tapping the second cell and so on.</p>
  
  <p>Can somebody please ell me how i have to do this? i have this code.</p>
  
  <pre><code>  - (NSInteger)tableView:(UITableView *)tableView
   numberOfRowsInSection:(NSInteger)section
  {
      return 3;//[array count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView
           cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = 
      [tableView dequeueReusableCellWithIdentifier:@"cell"];
  
      // create a cell
      if ( cell == nil)
      {
          cell = [[UITableViewCell alloc]
                  initWithStyle:UITableViewCellStyleSubtitle
                  reuseIdentifier:@"cell"];
      }
  
      //retrieve an image/ Zet een afbeelding naast de titel
      NSString *imagefile = [[NSBundle mainBundle]
                             pathForResource:@"cellimage" ofType:@"png"];
      UIImage *ui = [[UIImage alloc] initWithContentsOfFile:imagefile];
      //set the image on the table cell/ zet hem in de tabel
      cell.imageView.image = ui;
  
  
      //set the main text/hoofd tekst
      cell.textLabel.text = [exercises objectAtIndex:indexPath.row];
  
      //set the subtitle text/ ondertekst
      cell.detailTextLabel.text = @"Management training", @"Ondertiteling hier", @"Ondertiteling hier";
  
  
  
      //accessory type /zijn de navigatie pijltjes, er zijn 3 verschillende 
      cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
  
      //return the cell
      //cell.textLabel.text = [array objectAtIndex:indexPath.row];
      return cell;
  }
  
  /*
   // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
      if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
          // Custom initialization
      }
      return self;
  }
  */
  
  
  // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
  - (void)viewDidLoad {
      [super viewDidLoad];
      exercises = [[NSArray alloc]
                   initWithObjects:@"BAZO", @"Ontslag gesprek",
                   @"Management training",nil];
  
      self.title = @"Training lijst";
  
      //Probeerzel
      /*array = [[NSMutableArray alloc] init];
      [array addObject:@"Bazo"];
      [array addObject:@"secondmovie"];*/
  
  
      // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
      // self.navigationItem.rightBarButtonItem = self.editButtonItem;
  }
  
  // Customize the number of sections in the table view.
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
      return 1;
  }
  </code></pre>
  
  <p>i know its a lot of code  but this is the code of the table.</p>
  
  <p>I already imported the MediaPlayer.framework. but i don't know how to link a cell to a video.</p>
  
  <p>Thanks for your time!</p>
  
  <p>Bram</p>