xcode - prepareForSegue with multiple identifiers
<p>I have a tableView (not static cells) with two sections 
A bar section and a club section( and each has several cells). I want that every cell from the same section goes to the same viewcontroller. </p>

<p>I can only acces the first one, never the last one. Even de cells from the second section go to the first viewcontroller.</p>

<p>Can someone see my mistake?</p>

<pre><code>    override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
    // #warning Incomplete implementation, return the number of sections
    return 2
}

override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
    // #warning Incomplete implementation, return the number of rows
    if section == 0 {
    return areas.bars.count
    } else {

    return areas.clubs.count
}
}


override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {

    let cell = tableView.dequeueReusableCellWithIdentifier("mainIdentifier", forIndexPath: indexPath)
    if  indexPath.section == 0 {
        let bars = areas.bars
        let bar = bars[indexPath.row]

        cell.textLabel?.text = bar.name

        return cell
    } else {
        let clubs = areas.clubs
        let club = clubs[indexPath.row]

        cell.textLabel?.text = club.name

        return cell
    }
}
</code></pre>

<p>the segue:</p>

<pre><code>override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if segue.identifier == "barsandclubsIdentifier"{
        let selectedIndex = self.tableView.indexPathForSelectedRow!
        let selectedBar = self.areas.bars[selectedIndex.row]
       let detailBarsAndClubsViewController = segue.destinationViewController as! DetailBarOrClubViewController
    detailBarsAndClubsViewController.bars = selectedBar
    }
     else {
        let selectedIndex = self.tableView.indexPathForSelectedRow!
        let selectedClub = self.areas.clubs[selectedIndex.row]
        let detailBarsAndClubsTwoViewController = segue.destinationViewController as! DetailBarOrClubTwoViewController
        detailBarsAndClubsTwoViewController.clubs = selectedClub

    }
</code></pre>