Segue没有从Swift中的TableViewCell中发射

问题描述:

我已经设置了从UIButton继续运行,它工作正常,但是我在TableViewCell上设置的继续不起作用。Segue没有从Swift中的TableViewCell中发射

TableViewCell突出触摸,但segue不会触发。 TableViewCell高光灰色,但我将它设置为蓝色。

该segue是一个选择推塞格。

我已经在Objective-C中做了很多次,没有任何问题,为什么它不能在Swift中工作。

希望有人能帮助我。

+0

我认为灰色单元格的东西是一个测试版问题 - 我也看到了。提出一个与苹果的错误:http://bugreport.apple.com/ –

+0

“不行”,你的意思是prepareForSegue()永远不会被调用它吗? – NRitH

+0

是的prepareForSegue永远不会被调用。 – mickhsmith

我已经改变了以下解决我的问题: -

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell 
{ 
    let cell:UITableViewCell = UITableViewCell(style:UITableViewCellStyle.Default, reuseIdentifier:"categorycell") 
} 

改为: -

override func tableView(tableView: UITableView?, cellForRowAtIndexPath indexPath: NSIndexPath?) -> UITableViewCell? 
{ 
     let cell = tableView!.dequeueReusableCellWithIdentifier("categorycell", forIndexPath: indexPath) as UITableViewCell 
} 

和SEGUE现在闪光。

感谢大家谁试图帮助。